checkers pattern by Undermined

import java.io.*;import java.util.*;public class test{public static void main(String[] args) throws IOException{int a=0,b=0,c=1;String temp;\x09\x09InputStreamReader isr = new InputStreamReader(System.in);BufferedReader br = new BufferedReader(isr);temp = br.readLine();StringTokenizer st = new StringTokenizer(temp);a = Integer.parseInt(st.nextToken());b = Integer.parseInt(st.nextToken());for (int i = 0; i < a; i++) {for (int k = 0; k < b; k++) {System.out.print(c);if (c == 1)c = 0;else c = 1;if (k < b - 1)System.out.print(" ");}System.out.println();if (b % 2 == 0){if (c == 0) {c = 1;} else {c = 0;}}}}}\x0d

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page