-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBAEKJOON
More file actions
41 lines (30 loc) · 1007 Bytes
/
Copy pathBAEKJOON
File metadata and controls
41 lines (30 loc) · 1007 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.io.*;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br =new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw =new BufferedWriter(new OutputStreamWriter(System.out));
String str;
while((str=br.readLine())!= null) {
int low = 0;
int up = 0;
int num = 0;
int blank = 0;
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (c >= 65 && c <= 90) {
up++;
} else if (c >= 97 && c <= 122) {
low++;
} else if (c >= 48 && c <= 57) {
num++;
} else {
blank++;
}
}
bw.write(low + " " + up + " " + num + " " + blank+"\n");
bw.flush();
}
bw.close();
}
}