大家应该都是这么写的。
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
char ch=getchar();
if(ch>='0'&&ch<='9') cout<<1<<endl;
else if(ch>='A'&&ch<='Z') cout<<2<<endl;
else if(ch>='a'&&ch<='z') cout<<3<<endl;
else cout<<4<<endl;
return 0;
} 
京公网安备 11010502036488号