1 solutions
-
0
C :
#include <stdio.h> #include <string.h> char a[100]; int main() { gets(a); int i,len; len=strlen(a); for (i=0;i<100;i++) { if (a[i]<='y'&&a[i]>='a') { a[i]+=1; } else if (a[i]<='Y'&&a[i]>='A') { a[i]+=1; } else if (a[i]=='Z') { a[i]='A'; } else if (a[i]=='z') { a[i]='a'; } } printf ("%s",a); }
Python :
def jiami(c): if c=='z': return 'a' elif c=='Z': return 'A' elif c.isalpha(): return chr(ord(c)+1) else: return c str1=input().strip() for item in str1: print(jiami(item),end="")
- 1
Information
- ID
- 10398
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By