//1、学习到字符输入 //2、判断字符 #include<iostream> using namespace std; int main() { char a; cout<<"please input a charcter: "<<endl; cin>>a; if(a>‘0‘&&a<‘9‘) { cout<<"it‘s a numerical character!"<<endl; }else { cout<<"it‘s not a numerical character!"<<endl; } return 0; }
43.编写一个程序,判断用户输入的字符是否是数字,若是数字,则输出“a numerical character”
时间: 2024-10-03 21:54:20