| ||||||||||
| 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 | |||||||||
自己的机器上结果正确。submit就WA。帮忙看看那里的错啊~~~~谢谢大牛啦~~#include<stdio.h>
#include<string.h>
int main()
{
int n, count ,t,i,j;
char str[204],aa;
char a[102][22];
scanf("%d",&n);
while(n!=0)
{ scanf("%s",str);
count=0;
memset(a,'\0',2244);
while(str[count]!='\0')
{
a[count/n][count%n]=str[count];
count++;
}
for(i=1;i<=count/n;i=i+2)
{
for(j=0;j<(n-1)/2;j++)
{
aa=a[i][j];
a[i][j]=a[i][n-1-j];
a[i][n-1-j]=aa;
}
}
t=0;
for(i=0;i<n;i++)
{
for(j=0;j<count/n;j++)
{
str[t++]=a[j][i];
}
}
str[t]='\0';
printf("%s\n",str);
scanf("%d",&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