博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU1062 Text Reverse
阅读量:4217 次
发布时间:2019-05-26

本文共 639 字,大约阅读时间需要 2 分钟。

import java.io.BufferedInputStream;import java.util.Scanner;public class Main {	public static void main(String args[]) {		Scanner in = new Scanner(new BufferedInputStream(System.in));		int n = in.nextInt();		String s = in.nextLine();//吃掉换行符不可丢掉		while(n-- > 0) {			String string = in.nextLine();			String [] array = string.split(" ");			String temp = "";			for(int i = 0; i < array.length; i++ ) {				for(int j = array[i].length()-1; j >= 0; j-- ) {					temp += array[i].charAt(j);				}				if(i + 1 == array.length)					continue;				temp += " ";			}			if(string.endsWith(" "))//防止原字符串尾部有空格				temp += " ";			System.out.println(temp);		}	}}

转载地址:http://hoimi.baihongyu.com/

你可能感兴趣的文章
RobotFramework+Eclipse安装步骤
查看>>
测试的分类
查看>>
photoshop cc2019快捷键
查看>>
pycharm2019版本去掉下划线的方法
查看>>
九度OJ 1091:棋盘游戏 (DP、BFS、DFS、剪枝)
查看>>
leetcode 13: Roman to Integer
查看>>
a标签中调用js方法
查看>>
js函数中传入的event参数
查看>>
[hive]优化策略
查看>>
c++14现代内存管理
查看>>
右值引用,move语义和完美转发
查看>>
c++使用宏检测类是否包含某个函数或者变量属性
查看>>
CSS之Multi-columns的column-gap和column-rule
查看>>
CSS之Multi-columns的跨列
查看>>
CSS之浮动(一)
查看>>
CSS之浮动(二)
查看>>
AtomicInteger源码解析
查看>>
CopyOnWriteArraySet源码学习
查看>>
Openfiler 配置 NFS 示例
查看>>
Oracle 11.2.0.1 RAC GRID 无法启动 : Oracle High Availability Services startup failed
查看>>