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> int main() {char str1[]="END"; char str2[]="ENDOFINPUT"; char s[10]; char a[102]; char b[27]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char c[27]="VWXYZABCDEFGHIJKLMNOPQRSTU"; int i,j,k; while(gets(s)&&strcmp(str2,s)) {scanf("%c%c%c",&a[0],&a[1],&a[2]); i=3; while(!(a[i-3]=='E'&&a[i-2]=='N'&&a[i-1]=='D')) scanf("%c",&a[i++]); for(j=0;j<i-4;j++) for(k=0;k<26;k++) {if(a[j]==b[k]) {a[j]=c[k];break;} } for(j=0;j<i-4;j++) printf("%c",a[j]); printf("\n"); scanf("\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