Advertisement
Josif_tepe

Untitled

Mar 3rd, 2025
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 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.     for(int i = 0; i <= 500; i++) {
  9.         if(a + i > b and a + i > c) {
  10.             cout << i << endl;
  11.             break;
  12.         }
  13.     }
  14.     for(int i = 0; i <= 500; i++) {
  15.         if(b + i > a and b + i > c) {
  16.             cout << i << endl;
  17.             break;
  18.         }
  19.     }
  20.     for(int i = 0; i <= 500; i++) {
  21.         if(c + i > a and c + i > b) {
  22.             cout << i << endl;
  23.             break;
  24.         }
  25.     }
  26.  
  27.     return 0;
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement