#include <iostream>
#include <string>
using namespace std;
int main()
{
string x;
cout << "input 4 digit!" <<endl;
while(cin>>x)
{
int i = 0;
int length = x.size();
while( isdigit(x[i++]) )
{
if( i == length )
{
break;
}
}
if( i==length && isdigit(x[length-1]) )
{
cout << "legal input..." <<endl;
break;
}
cout <<endl;
cout << "illegal input, please input again !" <<endl
<< "and the wrong occured in the a["
<< i-1 <<"]'s " <<x[i-1]
<<" character!" <<endl;
}
system("PAUSE");
return 0;
}
//字符过滤。。。