Advertisement
Josif_tepe

Untitled

Mar 16th, 2024
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int a, b, c;
  6.     cin >> a >> b >> c;
  7.    
  8.     int pomosna = 0;
  9.     if(a >= 5) {
  10.         pomosna += 5;
  11.         a -= 5;
  12.     }
  13.     else {
  14.         pomosna += a;
  15.         a = 0;
  16.     }
  17.     if(b >= 5) {
  18.         pomosna += 5;
  19.         b -= 5;
  20.     }
  21.     else {
  22.         pomosna += b;
  23.         b = 0;
  24.     }
  25.     if(c >= 5) {
  26.         pomosna += 5;
  27.         c -= 5;
  28.     }
  29.     else {
  30.         pomosna += c;
  31.         c = 0;
  32.     }
  33.     if(abs(a - b) <= pomosna or abs(a - c) <= pomosna or abs(b - c) <= pomosna) {
  34.         cout << "DA" << endl;
  35.     }
  36.     else {
  37.         cout << "NE" << endl;
  38.     }
  39.     return 0;
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement