-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpfulmaths.java
44 lines (38 loc) · 1.15 KB
/
helpfulmaths.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
41
42
43
44
import java.io.*;
import java.util.*;
public class helpfulmaths {
public static void main(String[] args) {
FastScanner sc = new FastScanner();
PrintWriter pw = new PrintWriter(System.out);
String s=sc.next();
String s1="";
for(int i=49;i<=51;i++){
for(int j=0;j<s.length();j++){
if((s.charAt(j)==(char)i))
s1=s1+s.charAt(j)+'+';
}
}
pw.println(s1.substring(0,s.length()));
pw.close();
}
static class FastScanner {
BufferedReader br;
StringTokenizer st;
public FastScanner() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int ni() {
return Integer.parseInt(next());
}
}
}