-
Notifications
You must be signed in to change notification settings - Fork 1
/
DaoTu.java
40 lines (38 loc) · 1.13 KB
/
DaoTu.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package codeptit;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeSet;
/**
*
* @author Administrator
*/
public class DaoTu {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
sc.nextLine();
while(t-- > 0) {
String s = sc.nextLine();
List<String> l = new ArrayList<>();
StringTokenizer st = new StringTokenizer(s);
while(st.hasMoreTokens()){
l.add(st.nextToken());
}
for(int i=0; i<l.size(); i++){
String x = l.get(i);
for(int j=x.length()-1; j>=0; j--){
System.out.printf("%c", x.charAt(j));
}
System.out.print(" ");
}
System.out.println();
}
}
}