c++第四题20150324

来源:互联网 发布:知史以明鉴 查古以至今 编辑:程序博客网 时间:2024/06/05 06:02
#include<stdio.h>
void main()
{
 char c;
 int i=1;   
 while((c=getchar())!='\n')
  if(c<='0'||c>='9')   
  {
   i=0;
   break;
  }
    if(i==1) 
  printf("a numerical character\n");
 else
  printf("other character\n");
  
}
0 0
原创粉丝点击