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 |
谁能帮忙看一下,为什么会WA# 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