istream::getline
sets the fail bit if the input is too long, and that prevents further input. Change your code to:
#include<iostream>
using namespace std;
int main()
{
char test[10];
char cont[10];
cin.getline(test,10);
cin.clear(); // add this
cin.getline(cont,10);
cout<<test<<" is not "<<cont<<endl;
return 0;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…