-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathI043.java
More file actions
39 lines (37 loc) · 1.25 KB
/
I043.java
File metadata and controls
39 lines (37 loc) · 1.25 KB
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
package levelB;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class I043 {
public static void main(String[] args) throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
char[] c=br.readLine().toCharArray();
int count_P=0,count_A=0,count_T=0,count_e=0,count_s=0,count_t=0;
for(int i=0;i<c.length;i++){
switch (c[i]){
case 'P':count_P++;break;
case 'A':count_A++;break;
case 'T':count_T++;break;
case 'e':count_e++;break;
case 's':count_s++;break;
case 't':count_t++;break;
default:break;
}
}
int count=0;
for(int i=0;i<300;i++){
if(count<count_P)
System.out.print("P");
if(count<count_A)
System.out.print("A");
if(count<count_T)
System.out.print("T");
if(count<count_e)
System.out.print("e");
if(count<count_s)
System.out.print("s");
if(count<count_t)
System.out.print("t");
count++;
}
}
}