1 solutions
-
0
C :
#include<stdio.h> #include<string.h> int main() { char s1[100],s2[100]; int i,l; scanf("%s",s1); l=strlen(s1); for(i=0;i<l;i++) { if((s1[i]>='a'&&s1[i]<'w')||(s1[i]>='A'&&s1[i]<'W')) { s1[i]=s1[i]+4; } else s1[i]=s1[i]-22; } printf("%s\n",s1); }C++ :
#include<iostream> #include<cstdio> #include<iostream> using namespace std; int main(){ string str; while(cin>>str){ for(int i=0;i<str.length();i++) if(str[i]>='W'&&str[i]<='Z'||str[i]>='w'&&str[i]<='z') printf("%c",str[i]-22); else printf("%c",str[i]+4); cout<<endl; } return 0; }
- 1
Information
- ID
- 19580
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By