C语言 · 判定数字

编写函数,判断某个给定字符是否为数字。
样例输入
9
样例输出
yes

 

 

 1 #include<stdio.h>
 2 int main(){
 3     char c;
 4     scanf("%c",&c);
 5     if(c>='0' && c<='9'){
 6         printf("yes");
 7         return 0;
 8     }
 9     else
10         return 0;
11 } 

 

posted @ 2017-01-05 09:57  人间烟火地三鲜  阅读(411)  评论(0编辑  收藏  举报