Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110515 | 殷佳雨萱 | 字符的前导值和后继值 | C++ | Accepted | 1 MS | 276 KB | 378 | 2025-02-22 11:13:49 |
#include<bits/stdc++.h> using namespace std; char a; int main(){ a=cin.get(); int i=0; if(int(a-1)>=32 && int(a)-1<=126){ cout<<int(a)-1<<endl; } else if(int(a-1)<32 || int(a)-1>126){ cout<<"Input Error!"<<endl; } if(int(a+1)>=32 && int(a)+1<=126){ cout<<int(a)+1; } else if(int(a+1)<32 || int(a)+1>126){ cout<<"Input Error!"; } return 0; }