UVa 490 - Rotating Sentences
来源:互联网 发布:淘宝工具软件 编辑:程序博客网 时间:2024/06/07 07:34
字符串水题,旋转90度输出。注意字符串的长度和空格的处理。
code:
import java.util.*;public class Main490 {public static void main(String[] args) {Scanner scan = new Scanner(System.in);char[][] str = new char[105][105];String s;int[] length = new int[105];int cnt = 0, mlen = 0;while(scan.hasNextLine()) {s = scan.nextLine();str[cnt] = s.toCharArray();length[cnt] = s.length();if(length[cnt] > mlen)mlen = length[cnt];cnt ++;}for(int i=0; i<mlen; i++) {for(int j=cnt-1; j>=0; j--){if(length[j] > i)System.out.print(str[j][i]);elseSystem.out.print(" ");}System.out.println();}}}
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
- SQL Server 2008 R2
- Android SmartImageView源码分析
- LCT系列
- 用PendingIntent传送数据丢失解决办法
- Dalvik虚拟机相关的可执行程序
- UVa 490 - Rotating Sentences
- 静态绑定与动态绑定
- Ubuntu安装可视化的c++编译器
- 第十七周项目四 日期结构体
- 普通用户登录EM
- Android Touch 事件的分发和消费机制
- unity3D 编译警告
- Mac安装PIL失败的解决方案
- 引用作形参(1)