This problem requires programming, given the string of capital letters corresponding to the following replacement rule:
Original letter | The corresponding letter |
---|---|
A | FROM |
B | Y |
C | X |
D | W |
… | … |
X | C |
Y | B |
FROM | A |
Input formats:
Does not exceed a given input string of 80 characters, and a carriage return at the end of a row.
Output formats:
Replacement string given output row is completed.
Sample input:
Only the 11 CAPItaL LeTtERS are replaced.
Sample output:
Lnly the 11 XZKRtaO OeGtVIH are replaced.
answer:
#include<stdio.h>
#include<string.h>
int main(){
char s[85];
char c;
char a[]={'Z'};
scanf("%[^\n]",&s);
int len=strlen(s);
for(int i=0;i<len;i++){
if(s[i]>='A'&&s[i]<='Z'){
printf("%c",155 - s[i]);
}else{
printf("%c",s[i]);
}
}
return 0;
}