1 solutions
-
0
C :
#include <stdio.h> int main() { char str; scanf("%c",&str); if( str>65&&str<90 || str>97&&str<122){ printf("%c%c%c",str-1,str,str+1); }else if( str==65 ){ printf("%c%c%c",str+25,str,str+1); }else if( str==90 ){ printf("%c%c%c",str-1,str,str-25); }else if( str==97 ){ printf("%c%c%c",str+25,str,str+1); }else if( str==122){ printf("%c%c%c",str-1,str,str-25); } return 0; }C++ :
#include<iostream> using namespace std; int main(){ char a,b,c; cin>>b; switch (b){ case 'a':a='z';c=b+1;break; case 'A':a='Z';c=b+1;break; case 'z':c='a';a=b-1;break; case 'Z':c='A';a=b-1;break; default: a=b-1; c=b+1; } cout<<a<<b<<c<<endl; return 0; }
- 1
Information
- ID
- 18352
- Time
- 1000ms
- Memory
- 32MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By