UVa 490 - Rotating Sentences
来源:互联网 发布:fifaol3韩服数据库 编辑:程序博客网 时间:2024/06/11 21:11
题目:给你一篇文章,将文章旋转顺时针90度输出。
分析:字符串,模拟。找到最大的单词长度,按照列行的顺序输出。
说明:没有字符的地方,用空格填充。
#include <iostream>#include <cstdlib>#include <cstring>#include <cstdio>using namespace std;char Satz[110][110];int main(){memset( Satz, 0, sizeof(Satz) );int count = 0;int maxs = 0;while ( gets(Satz[count]) ) {if ( maxs < strlen(Satz[count]) )maxs = strlen(Satz[count]);count ++;}for ( int i = 0 ; i < count ; ++ i )for ( int j = 0 ; j < maxs ; ++ j )if ( !Satz[i][j] )Satz[i][j] = ' '; for ( int i = 0 ; i < maxs ; ++ i ) {for ( int j = count-1 ; j >= 0 ; -- j )printf("%c",Satz[j][i]);printf("\n");}//system("pause");return 0;}
0 0
- Uva 490 Rotating Sentences
- UVa 490 - Rotating Sentences
- UVA-490-Rotating Sentences
- UVa 490 - Rotating Sentences
- UVA 490 - Rotating Sentences
- UVa 490 - Rotating Sentences
- UVa:490 - Rotating Sentences
- UVA 490 Rotating Sentences
- UVA:490 - Rotating Sentences
- UVA - 490 - Rotating Sentences
- UVa 490 - Rotating Sentences
- UVa 490 - Rotating Sentences
- UVa 490 Rotating sentences
- UVA - 490 Rotating Sentences
- UVA 490 Rotating Sentences
- UVA - 490 Rotating Sentences
- UVa 490 - Rotating Sentences
- UVA 490 Rotating Sentences
- 为生活可以忍,侮辱技术行不行?(转载)
- Add Two Numbers
- 三年总结与后五年目标
- Map/Reduce Task 远程调试详解
- [android开发]手写签名系统的设计与实现之实现pdf文件上手写签名效果(五)---完
- UVa 490 - Rotating Sentences
- Hadoop2.2 + spark1.0 在ubuntu 上搭建分布式集群
- UVa 10010 - Where's Waldorf?
- 第三周作业——冒泡排序和归并排序
- Oracle to_char格式化函数
- Java web工程乱码解决方案
- 第三周作业——顺序查找和二分查找
- CSS定位与层叠
- unity基础开发----延迟等待执行代码