Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
124745 | 晏莞煜 | 字符的前导值和后继值 | C++ | Compile Error | 0 MS | 0 KB | 687 | 2025-07-12 11:58:34 |
#include<iostream> using namespace std; int main(){ /** char a; cin>>a; if(a>='A' and a<='Z'){ if(a=='A' or a=='E' or a=='I' or a=='O' or a=='U'){ cout<<"Upper Vowel"; }else{ cout<<"Upper Letter"; } }else if(a>='a' and a<='z'){ if(a=='a' or a=='e' or a=='i' or a=='o' or a=='u'){ cout<<"Lower Vowel"; }else{ cout<<"Lower Letter"; } }else if(a<='9' and a>='0'){ cout<<"Digit"; }else{ cout<<"Other"; } **/ char a=getchar(); if(c-1>=32 && c-1<=126){ cout<<c-1<<endl; }else{ cout<<"Input Error!"; } if(c+1>=32 && c+1<=126){ cout<<c+1<<endl; }else{ cout<<"Input Error!"; } return 0; }
Main.cc: In function 'int main()': Main.cc:25:5: error: 'c' was not declared in this scope if(c-1>=32 && c-1<=126){ ^ Main.cc:30:5: error: 'c' was not declared in this scope if(c+1>=32 && c+1<=126){ ^ Main.cc:24:7: warning: unused variable 'a' [-Wunused-variable] char a=getchar(); ^