View Code of Problem 113

import java.util.Scanner;

public class Main6 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String get = scanner.nextLine();
            String[] split = get.split(" ");
            int n1 = Integer.parseInt(split[0]);
            int n2 = Integer.parseInt(split[1]);
            System.out.println(n1 + n2);
            System.out.println();
        }
    }
}
/*
Main.java:3: error: class Main6 is public, should be declared in a file named Main6.java
public class Main6 {
       ^
1 error
*/

Double click to view unformatted code.


Back to problem 113