判断是不是字母,不区分大小写
#include<iostream> #include<cctype> using namespace std; int main() { char s; while(cin >> s) { if(isalpha(s)) cout << s << " is an alphabet." << endl; else cout << s << " is not an alphabet." << endl; } return 0; }
判断是不是字母,不区分大小写
#include<iostream> #include<cctype> using namespace std; int main() { char s; while(cin >> s) { if(isalpha(s)) cout << s << " is an alphabet." << endl; else cout << s << " is not an alphabet." << endl; } return 0; }