Răspuns:
#include <iostream>
using namespace std;
void calcul() {
int total = 0;
int a, b, c;
cout << "Introduceti a,b,c: " << endl;
cout << "a = ";
cin >> a;
cout << "b = ";
cin >> b;
cout << "c = ";
cin >> c;
if ((a > b) && (a > c)) {
if (b > c) {
total = a + b;
} else {
total = a + c;
}
} else if ((c > a) && (c > b)) {
if (a > b) {
total = c + a;
} else {
total = c + b;
}
} else if ((b > a) && (b > c)) {
if (a > c) {
total = b + a;
} else {
total = b + c;
}
}
cout << "Raspunsul este: " << total;
}
int main ()
{
calcul();
return 1;
}
Explicație: