Uva 10222 - Decode the Mad man
2013-04-04 22:08
330 查看
水题
字符串替换
1Y
字符串替换
1Y
#include<stdio.h> #include<string.h> char s[]="?czaqsdfyghjbvui?w?etx??r?"; char f(char x){ if(x>='A'&&x<='Z')return s[x-'A']; if(x>='a'&&x<='z')return s[x-'a']; if(x=='[')return 'o'; if(x==']')return 'p'; if(x==';')return 'k'; if(x=='\'')return 'l'; if(x==',')return 'n'; if(x=='.')return 'm'; if(x=='?')return ','; if(x=='\\')return '['; return x; } int main(){ char s[1010]; while(gets(s)!=NULL){ int i,len=strlen(s); for(i=0;i<len;i++)printf("%c",f(s[i])); printf("\n"); } return 0; }
相关文章推荐
- uva 10222 - Decode the Mad man
- UVA10222 Decode the Mad man【编码】
- UVa 10222 - Decode the Mad man
- UVa 10222-Decode the Mad man
- [解题报告]Decode the Mad man
- Q10222: Decode the Mad man
- UVA 10878 Decode the tape
- UVA10878 - 详解Decode the tape
- uva 10785 The Mad Numerologist
- UVA之10878 - Decode the tape
- uva 10878 decode the tape
- UVA 10482 The Candyman Can
- uva 10785 The Mad Numerologist
- UVa 10878 - Decode the tape
- UVA 10878 (暑假-字符串(2) -C - Decode the tape)
- uva 10878 - Decode the tape
- Uva 10785 - The Mad Numerologist
- UVA10878 Decode the tape【编码】
- UVa 10785 - The Mad Numerologist
- UVa 10878 Decode the tape