CSES - Aalto Competitive Programming 2024 - wk1 - Mon - Results
Submission details
Task:Backpacking
Sender:Sakari
Submission time:2024-09-02 16:42:15 +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
1 error

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.println(x1);
    }
}