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 |
Re:谁能帮忙看一下,为什么会WAIn Reply To:谁能帮忙看一下,为什么会WA Posted by:saren at 2007-08-01 15:19:56 > # include <stdio.h> > # include <string.h> > > main(){ > int key,len,i,temp; > char code[75],plain[75]; > while (scanf("%d",&key),key){ > scanf("%s",code); > len=strlen(code); > plain[len]=0; > for (i=0;i<len;i++){ > switch (code[i]){ > case '_' : temp=(1+i)%28;break; > case '.' : temp=(27+i)%28;break; > default : temp=(code[i]-'a'+1+i)%28; > } > switch (temp){ > case 0 : plain[(i*key)%len]='_';break; > case 27 : plain[(i*key)%len]='.';break; > default : plain[(i*key)%len]=temp+'a'-1; > } > } > puts(plain); > } > } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator