Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
水题一个。贴个代码(最传统的打表)#include"stdio.h" #include"string.h" int main() { char s[100]; char a[100]; s[';'] = 'L'; s['L'] = 'K'; s['K'] = 'J'; s['J'] = 'H'; s['H'] = 'G'; s['G'] = 'F'; s['F'] = 'D'; s['D'] = 'S'; s['S'] = 'A'; s[','] = 'M'; s['M'] = 'N'; s['N'] = 'B'; s['B'] = 'V'; s['V'] = 'C'; s['C'] = 'X'; s['X'] = 'Z'; s['['] = 'P'; s['P'] = 'O'; s['O'] = 'I'; s['I'] = 'U'; s['U'] = 'Y'; s['Y'] = 'T'; s['T'] = 'R'; s['R'] = 'E'; s['E'] = 'W'; s['W'] = 'Q'; s['/'] = '.'; s['\''] = ';'; s[']'] = '['; s['\\'] = ']'; s['.'] = ','; s['='] = '-'; s['-'] = '0'; s['0'] = '9'; s['9'] = '8'; s['8'] = '7'; s['7'] = '6'; s['6'] = '5'; s['5'] = '4'; s['4'] = '3'; s['3'] = '2'; s['2'] = '1'; s['1'] = '`'; s[' ']=' '; while(gets(a)) { int i; for(i=0;i<strlen(a);i++) printf("%c",s[a[i]]); printf("\n"); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator