Task: | Backpacking |
Sender: | Sakari |
Submission time: | 2024-09-02 16:38:00 +0300 |
Language: | Java |
Status: | COMPILE ERROR |
Compiler report
input/test.java:6: error: cannot find symbol String[] arrS = String.c.split(); ^ symbol: variable c location: class String input/test.java:11: error: package console does not exist console.out.printn(x1); ^ 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; } console.out.printn(x1); } }