-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva272.java
More file actions
35 lines (32 loc) · 923 Bytes
/
Copy pathUva272.java
File metadata and controls
35 lines (32 loc) · 923 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
import java.util.*;
import java.io.*;
public class Uva272
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
PrintWriter pr = new PrintWriter(System.out);
String str ;
boolean staus =false ;
while((str = br.readLine()) != null)
{
int len = str.length();
for (int i = 0; i < len; i++)
{
if(str.charAt(i) == '"')
{
if(staus) sb.append("''");
else sb.append("``");
staus = !staus ;
}
else
sb.append(str.charAt(i));
}
sb.append("\n");
}
pr.print(sb.toString());
pr.close();
br.close();
}
}