如何让程序只允许用户输入_数字_的问题!!!
#include <stdio.h>#include <ctype.h>
int main (void)
{
int xy = 0;
printf("\nThis progarm is build a Mult-sheet.");
do
{
printf("\nPlase input a number for build the Mul-sheet : ");
fflush(stdin);
scanf("%d", &xy);
}
while(isalpha(xy) || isspace(xy));
for(int i = 1; i <= xy ; ++i)
{
for(int j = 1; j <= xy; ++j)
{
printf("\t%d", i*j);
}
printf("\n\n");
}
return 0;
}