Skip to content
GG
Ghost Graph
Ghost Graph: Interlinked notes, diagnostics, and proven scripts rendered as a navigable 3D graph.
Reading

Kattis Challenge "Sum of Others"

Return to map

Problem

My solution

import java.util.Scanner;
public class SumOfOthers {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String[] temp = sc.nextLine().split(" ");
            int answer = 0;
            for (int i = 0; i < temp.length; i++) {
                answer += Integer.parseInt(temp[i]);
            }
            System.out.println(answer/2);
        }
    }
}