我记得isdigit()的用法是如果参数为数字,则返回ture。但是使用过程中还是有些弄不明白的地方,比如说下面的程序:
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
int n;
cin>>n;
if(isdigit(n))
cout<<"Yes";
else
cout<<"No";
return 0;
}
凤凰求蛊
湖上湖
桃花长相依
陪伴而非守候
随时随地看视频慕课网APP
相关分类