CSES - Aalto Competitive Programming 2024 - wk1 - Mon - Results
Submission details
Task:Backpacking
Sender:Sakari
Submission time:2024-09-02 16:41:52 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/test.java:7: error: cannot find symbol
        String[] arrS = String.c.split();
                              ^
  symbol:   variable c
  location: class String
input/test.java:12: error: cannot find symbol
        System.out.printn(x1);
                  ^
  symbol:   method printn(int)
  location: variable out of type PrintStream
2 errors

Code

public class test{

    public static void main( String args[]){
        int x1 = 0;
        String c = System.console().readLine();
        String[] arrS = String.c.split();
        for (String x : arrS){
            int a = Integer.parseInt(x);
            x1 += a;
        }
        System.out.printn(x1);
    }
}