when the user enters three number show him true if the total of two numbers is equal to the third.
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> vec(3);
for (int i=0; i<3; i++)
cin>>vec[i];
sort(vec.begin(), vec.end());
if (vec[0]+vec[1]==vec[2])
cout << true << endl;
else
cout << false << endl;
return 0;
}
Comments
Leave a comment