#include<iostream>
using namespace std;
int main() {
cout << "please enter a character" << endl;
char c;
c=cin.get();
if (c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z') {
cout << c << " is a letter" << endl;
}
else if (c >= '0' && c <= '9') {
cout << c << " is a number" << endl;
}
else if (c == ' ') {
cout << c << " is a blank space" << endl;
}
else
cout << c << " is the other character" << endl;
return 0;
}
测试详情