| ||||||||||
| 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 | |||||||||
为什么我的poj2913过不了?高手指教http://poj.grids.cn/problem?id=2913
#include <stdio.h>
#include <string.h>
char a[1000];
char zh(int c)
{
if (c<' ')
return c+91;
if (c>'z')
return c-91;
return c;
}
main()
{
char w,b[8]="4962873";
int i=0,j;
scanf("%c",&w);
while(w!='\n')
{
a[i]=w;
scanf("%c",&w);
i++;
}
a[i]='\0';
i=0;
for (j=0;j<strlen(a);j++)
{
a[j]=zh(a[j]+(b[i%7]-'0'));
i++;
}
printf("%s\n",a);
i=0;
for (j=0;j<strlen(a);j++)
{
a[j]=zh(a[j]-(b[i%7]-'0'));
i++;
}
printf("%s\n",a);
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator