根据C的规定,scanf()的返回值:
你可以试着运行下下面这段代码
#include
int main()
{
int m,n;
n=scanf("%d",&m);
printf("%d",n);
}
可以发现当输入数字时,输出1;当输入字母时,输出0;
这样就可以根据scan()的返回值来做出这个命令。
char choice;
cout<<"DO you want to continue?\n Please input y to continue, input n to exit.";
cin>>choice;}
while (choice=='y');
return 0;
ch=getchar();
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
exit(0);