我是C++的新手,我学习了一些C语言的基础知识.这是我的代码片段.
#include "iostream"
using namespace std;
int main(){
int a=108;
if(!isdigit(a)){
cout<<"The number is not a digit";
}
else
cout<<"It's a Number!";
}
Run Code Online (Sandbox Code Playgroud)
我不知道为什么,但它满足条件.它应该输出,It's a Number!请纠正我,如果你有更好的解决方案,建议!(为了更清楚)我想检查输入的int是否实际上由数字组成.谢谢