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 |
这样水过50题的~~5555,太笨了#include<stdio.h> #include<string.h> int main() { char a[26],b[80]; int i,n; gets(a); gets(b); n=strlen(b); for(i=0;i<n;i++) { if(b[i]=='a') printf("%c",a[0]); else if(b[i]=='b') printf("%c",a[1]); else if(b[i]=='c') printf("%c",a[2]); else if(b[i]=='d') printf("%c",a[3]); else if(b[i]=='e') printf("%c",a[4]); else if(b[i]=='f') printf("%c",a[5]); else if(b[i]=='g') printf("%c",a[6]); else if(b[i]=='h') printf("%c",a[7]); else if(b[i]=='i') printf("%c",a[8]); else if(b[i]=='j') printf("%c",a[9]); else if(b[i]=='k') printf("%c",a[10]); else if(b[i]=='l') printf("%c",a[11]); else if(b[i]=='m') printf("%c",a[12]); else if(b[i]=='n') printf("%c",a[13]); else if(b[i]=='o') printf("%c",a[14]); else if(b[i]=='p') printf("%c",a[15]); else if(b[i]=='q') printf("%c",a[16]); else if(b[i]=='r') printf("%c",a[17]); else if(b[i]=='s') printf("%c",a[18]); else if(b[i]=='t') printf("%c",a[19]); else if(b[i]=='u') printf("%c",a[20]); else if(b[i]=='v') printf("%c",a[21]); else if(b[i]=='w') printf("%c",a[22]); else if(b[i]=='x') printf("%c",a[23]); else if(b[i]=='y') printf("%c",a[24]); else if(b[i]=='z') printf("%c",a[25]); else if(b[i]=='A') printf("%c",a[0]-32); else if(b[i]=='B') printf("%c",a[1]-32); else if(b[i]=='C') printf("%c",a[2]-32); else if(b[i]=='D') printf("%c",a[3]-32); else if(b[i]=='E') printf("%c",a[4]-32); else if(b[i]=='F') printf("%c",a[5]-32); else if(b[i]=='G') printf("%c",a[6]-32); else if(b[i]=='H') printf("%c",a[7]-32); else if(b[i]=='I') printf("%c",a[8]-32); else if(b[i]=='J') printf("%c",a[9]-32); else if(b[i]=='K') printf("%c",a[10]-32); else if(b[i]=='L') printf("%c",a[11]-32); else if(b[i]=='M') printf("%c",a[12]-32); else if(b[i]=='N') printf("%c",a[13]-32); else if(b[i]=='O') printf("%c",a[14]-32); else if(b[i]=='P') printf("%c",a[15]-32); else if(b[i]=='Q') printf("%c",a[16]-32); else if(b[i]=='R') printf("%c",a[17]-32); else if(b[i]=='S') printf("%c",a[18]-32); else if(b[i]=='T') printf("%c",a[19]-32); else if(b[i]=='U') printf("%c",a[20]-32); else if(b[i]=='V') printf("%c",a[21]-32); else if(b[i]=='W') printf("%c",a[22]-32); else if(b[i]=='X') printf("%c",a[23]-32); else if(b[i]=='Y') printf("%c",a[24]-32); else if(b[i]=='Z') printf("%c",a[25]-32); else printf("%c",b[i]); } printf("\n"); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator