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