1. Список говнокодов пользователя timkabor

    Всего: 1

  2. Java / Говнокод #20475

    +6

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 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);
        }}

    timkabor, 05 Августа 2016

    Комментарии (1)