Click Here to go back to the homepage.

Sum of the Others Solution:


#include <bits/stdc++.h>
using namespace std;

int calculate(string s){
    int sum = 0;
    stringstream ss(s);
    int i = 0;
    while(ss >> i){
        sum += i;
    }
    return sum / 2;
}

int main(){
    // #ifndef TESTING
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif

    string line;
    while(getline(cin, line)){
        cout << calculate(line) << endl;
    }
    
    return 0;   
}