-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ03004.java
More file actions
24 lines (24 loc) · 790 Bytes
/
J03004.java
File metadata and controls
24 lines (24 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.*;
public class J03004 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = Integer.parseInt(in.nextLine());
while(t-->0){
String s = in.nextLine();
System.out.println(chuanHoa(s));
}
}
public static String chuanHoa(String s) {
StringBuilder kq = new StringBuilder();
StringTokenizer st = new StringTokenizer(s);
while(st.hasMoreTokens()){
String tmp = st.nextToken();
kq.append(Character.toUpperCase(tmp.charAt(0)));
for (int i=1;i<tmp.length();i++){
kq.append(Character.toLowerCase(tmp.charAt(i)));
}
kq.append(" ");
}
return kq.toString().trim();
}
}