STL -- isalpha()
判断是不是字母
http://www.nowcoder.com/questionTerminal/91a588dd4cd244bfa616f17603ec123c
判断是不是字母,不区分大小写
#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;
}
查看14道真题和解析