|核心|
注意!输入为a或z时要特判
字符以char类型定义变量
#include<bits/stdc++.h> using namespace std; char c; int main() { cin>>c; if(c=='a') { cout<<'z'<<c<<'b'; }else if(c=='z') { cout<<'y'<<c<<'a'; }else { cout<<char(c-1)<<c<<char(c+1); } return 0; }
使用您的 NarmoOJ 通用账户