int cnt = 0;
char Array[100] = { 0 };
unsigned int Len = 0;
int main( void )
{
while(1)
{
printf("Please input a number !\n");
gets( Array );
Len = strlen( Array );
while(Array[cnt++] != ' ');
if(Len > cnt)
{
printf("The number input is wrong !\n");
}
else
{
printf("The number input is correct !\n");
}
cnt = 0;
}
return 0;
}
|