#include <iostream>
#include <string>
#include <fstream>
using namespace std;
#define M 11
#define N 10
int main()
{
char FileName[12];
string WordInFile;
char WORD[M][N]={"and","if","else","int","while","struct",
"define","include","void","main","printf"};
cout<<"input your file name please: ";
cin>>FileName;
ifstream fin(FileName);
while ( fin>>WordInFile ) //WordInFile ????????????
{
cout<<WordInFile<<" -------- ";
if ( WordInFile.length() > N ) cout<<"The word is too long!"<<endl;
else
{
for ( int i = 0 ; i < M ; ++i )
if ( WORD[i] == WordInFile ) //WordInFile ????????????
{
cout<<"key word!"<<endl;
break;
}
if ( i >= M ) cout<<"user-defined!"<<endl;
}
}
fin.close();
return 0;
}