- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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.*;
public class ascii {
private static String readString() {
//TODO not implemented yet
return null;
}
private static void writeString(String s) {
try
{ try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("output.txt"), "ascii"))) { writer.write(s); }
}
catch (IOException ex) { }
}
public static void main(String[] args) {
String s;
//s = readString();
String xs = "";
try
{
java.util.Scanner sc = new java.util.Scanner(new File("input.txt"));
while (sc.hasNextLine()) xs += sc.nextLine() + "\n";
} catch (FileNotFoundException ex) { }
s = xs;
int c = 0; int x; x = s.length(); String result = "";
while (c < x) {
char ch = s.charAt(c);
if (ch == 'o') { result += "X";
} else if (ch == 'O') {
result += "X";
} else if (ch == '.')
result += "X";
else if (ch == '`') { result += "X";
} else if (ch == '\'') {
result += "X";
} else if (ch == ' ')
result += " ";
else if (ch == '\n') {
result += "\n";
} c++; }
writeString(result);
}}
guest 06.08.2016 11:41 # +15