The variable line records the number of lines of input,and the variable len records the maximum of length.
Pay attention to that a space is different from another space!
Deleting those code between "//* ... //*/",though you can not recognize the difference between the outputs of those two programs in the Notebook,the judge will present you a WA...
Here is my code:
#include<stdio.h>
#include<string.h>
#define maxn 107
int line,len;
char s[maxn][maxn];
int main()
{
memset(s,0,sizeof(s));
line=len=0;
while(gets(s[line]))
{
if(len<strlen(s[line]))
len=strlen(s[line]);
line++;
}
//*
for(int i=0;i<line;i++)
for(int j=0;j<len;j++)
if(!s[i][j])
s[i][j]=' ';
//*/
for(int i=0;i<=len-1;i++)
{
for(int j=line-1;j>=0;j--)
putchar(s[j][i]);
putchar('\n');
}
return 0;
}
posted on 2011-01-23 17:49
lee1r 阅读(865)
评论(0) 编辑 收藏 引用 所属分类:
题目分类:字符串处理