算法训练 判定数字
时间限制:1.0s 内存限制:512.0MB
编写函数,判断某个给定字符是否为数字。
样例输入
9
样例输出
yes
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
char c;
cin>>c;
if(c>='0' && c<='9'){
cout<<"yes"<<endl;
}else{
cout<<"no"<<endl;
}
return 0;
}