PersonalCorpus 版 (精华区)
41700 2002-10-15 02:32:26 Accepted
1042 C++ 00:00.01 380K Big Guava
int main()
{
#ifndef ONLINE_JUDGE
freopen("c:\\0acm\\zju\\i1042","r",stdin);
freopen("c:\\0acm\\zju\\o1042","w",stdout);
#endif
int i,j,k,a,b,c;
char s[100],t[100];
char x[100],ch,tmp;
int y[100];
while (1) {
scanf("%d%d%d\n",&a,&b,&c);
if ((a==0)&&(b==0)&&(c==0)) break;
gets(s);
k=0;
for (i=0;i<strlen(s);i++) if ((s[i]>='a')&&(s[i]<='i')) {
x[k]=s[i]; y[k]=i; k++;
}
for (i=0;i<k;i++) t[y[(a%k+i)%k]]=x[i];
k=0;
for (i=0;i<strlen(s);i++) if ((s[i]>='j')&&(s[i]<='r')) {
x[k]=s[i]; y[k]=i; k++;
}
for (i=0;i<k;i++) t[y[(b%k+i)%k]]=x[i];
k=0;
for (i=0;i<strlen(s);i++) if
(((s[i]>='s')&&(s[i]<='z'))||(s[i]=='_')) {
x[k]=s[i]; y[k]=i; k++;
}
for (i=0;i<k;i++) t[y[(c%k+i)%k]]=x[i];
t[strlen(s)]=0;
printf("%s\n",t);
}
}
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:8.412毫秒