Add tags

Add tags to the following comment
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Sample137 {
    public static int sum(String[] input) {
        int sum = 0;
        for (String s: input) {
            sum += Integer.parseInt(s);
        }
        return sum;
    }

    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            int s = sum(reader.readLine().split("\\s+"));
            int t = sum(reader.readLine().split("\\s+"));
            System.out.println(Math.max(s, t));
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...