Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2584 邓程允 字符的前导值和后继值 C++ Accepted 0 MS 256 KB 381 2024-01-13 18:08:33

Tests(10/10):


Code:

# include<iostream> using namespace std; int main(){ char ch; ch=cin.get(); if((int)ch-1<32||(int)ch-1>126){ cout<<"Input Error!"<<endl; } else { cout<<(int)ch-1<<endl; } if((int)ch+1<32||(int)ch+1>126){ cout<<"Input Error!"<<endl; } else { cout<<(int)ch+1<<endl; } return 0; }