ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1933. Guns for Battle!

solution keeps getting marked as incorrect...
Posted by noob dev 31 Dec 2014 10:51
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;
        }
}
}