-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva10878.java
More file actions
26 lines (25 loc) · 836 Bytes
/
Copy pathUva10878.java
File metadata and controls
26 lines (25 loc) · 836 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
import java.text.DecimalFormat;
import java.util.*;
import java.io.*;
public class Uva10878 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(System.out);
StringBuilder sb = new StringBuilder();
while(br.ready()){
String binary = "";
String s = br.readLine();
for (int i = 0; i < s.length(); i++) {
if(s.charAt(i)=='o')
binary+='1';
else if(s.charAt(i)==' ')
binary+='0';
}
if(!binary.isEmpty())
sb.append((char)Integer.parseInt(binary,2));
}
pr.print(sb.toString());
pr.close();
br.close();
}
}