fork download
  1. import java.util.Scanner;
  2.  
  3. public class Sample {
  4. public static void main(String[] args) {
  5. Scanner in = new Scanner(System.in);
  6. int N = in.nextInt();
  7. int ans = 0;
  8. for(int i = 0;i < N;++i) {
  9. ans += in.nextInt();
  10. }
  11. System.out.println(ans);
  12. }
  13. }
  14.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class Sample is public, should be declared in a file named Sample.java
public class Sample {
       ^
1 error
stdout
Standard output is empty