Click
Here to go back to the homepage.
Patuljci Solution:
#include <bits/stdc++.h>
using namespace std;
int main(){
// #ifndef TESTING
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
int n_hats = 9;
int sum = 0;
int hats[n_hats];
int i, j;
for(i = 0; i < 9; i++){
cin >> hats[i];
sum += hats[i];
}
for(i = 0; i < 8; i++){
for(j = 1; j < n_hats; j++){
if(i == j){
continue;
}
if(sum - hats[i] - hats[j] == 100){
goto end;
}
}
}
end:
for(int k = 0; k < n_hats; k++){
if(k != i && k != j){
cout << hats[k] << endl;
}
}
return 0;
}