Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main() {
- int a, b, c;
- cin >> a >> b >> c;
- int niza[3];
- niza[0] = a;
- niza[1] = b;
- niza[2] = c;
- sort(niza, niza + 3);
- a = niza[0];
- b = niza[1];
- c = niza[2];
- int max_a = a, max_b = b, max_c = c;
- if(a >= 5) {
- max_a = 5;
- }
- if(b >= 5) {
- max_b = 5;
- }
- if(c >= 5) {
- max_c = 5;
- }
- int sum = max_a + max_b + max_c;
- if(a + sum - max_a >= b - max_b or a + sum - max_a >= c - max_c or b + sum - max_b >= c - max_c) {
- cout << "DA" << endl;
- }
- else {
- cout << "NE" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement