水题,最近做水体练手
#include "stdio.h"
char a[200][200];
int main(int argc, char* argv[])
{
int i, j , index,m;
char c;
while (scanf("%d",&index) && index != 0)
{
getchar();
m = 0 ;
while (scanf("%c",&c) && c!= '\n')
{
a[m][0] = c ;
for ( i = 1 ; i < index ; ++i )
{
scanf("%c",&a[m][i]);
}
++m ;
scanf("%c",&c);
if (c == '\n')
{
break;
}
else
{
a[m][index-1] = c ;
for (i = index- 2 ; i >= 0 ; --i )
{
scanf("%c",&a[m][i]);
}
++m;
}
}
for ( i = 0 ; i < index ; ++i)
{
for (j = 0 ; j < m ; ++j )
{
printf("%c",a[j][i]);
}
}
printf("\n");
}
return 0;
}