|
|
back to boardsolution keeps getting marked as incorrect... My solution for "guns for battle" keeps getting marked as wrong and I don't know why. Any ideas? import java.util.*; import java.io.*; public class Gunner{ public static void main(String[] args) throws Exception{ StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); PrintWriter out = new PrintWriter(System.out); in.nextToken(); int n = (int)in.nval; int x = (2 * n) + 1;
int r = 1, c=1; while( r <= x) { while(c <= x){ if(r == c) out.print(0+" "); else out.print((r-1) + (c-1))+" "); out.flush(); ++c; } out.println(); out.flush(); c = 1; ++r; } } } |
|
|