`
ssun125
  • 浏览: 40894 次
文章分类
社区版块
存档分类
最新评论

Uva 490 Rotating Sentences

 
阅读更多
#include<stdio.h>
#include<string.h>

int main()
{
	char ch[110][110];
	int i=0,j,k;
	int max;
	while(gets(ch[i])!=NULL)
	{
		if(i==0)
			max = strlen(ch[i]);
		else if(max<strlen(ch[i]))
			max = strlen(ch[i]);
		i++;
	}
	for(j=0;j<max; j++)
	{
		for(k=i-1; k>=0;k--)
		{
			if(j<strlen(ch[k]))
				printf("%c",ch[k][j]);
			else  if(k!=0)
				printf(" ");
		}
		printf("\n");
	}
	return 0;
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics