Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
7437 | 詹梓涵 | 字符类型 | C++ | Accepted | 0 MS | 264 KB | 952 | 2025-04-26 10:16:12 |
#include<bits/stdc++.h> using namespace std; int main(){ //判断字符类型 //char a; //cin>>a; //1.判断字符类型的函数: //isalpha(a):判断字符a是否为字母 //isupper(a):判断字符a是否为大写字母 //islower(a):判断字符a是否为小写字母 //isdigit(a):判断字符a是否为数字 //if(isalpha(a)) cout<<"字母"; char i; cin>>i; if(isupper(i)){ if(i=='A'||i=='E'||i=='I'||i=='O'||i=='U'){ cout<<"Upper Vowel"<<endl; } else{ cout<<"Upper Letter"<<endl; } } else if(islower(i)){ if(i=='a'||i=='e'||i=='i'||i=='o'||i=='u'){ cout<<"Lower Vowel"<<endl; } else{ cout<<"Lower Letter"<<endl; } } else if(isdigit(i)){ cout<<"Digit"<<endl; } else{ cout<<"Other"<<endl; } return 0; }