Advertisement
Josif_tepe

Untitled

Mar 1st, 2025
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int a[3];
  7.     cin >> a[0] >> a[1] >> a[2];
  8.    
  9.     int A = -1, B = -1, C = -1;
  10.    
  11.     for(int i = 0; i <= 500; i++) {
  12.         int tmpa = a[0] + i;
  13.         if(tmpa > a[1] and tmpa > a[2] and A == -1) {
  14.             A = i;
  15.         }
  16.        
  17.         int tmpb = a[1] + i;
  18.         if(tmpb > a[0] and tmpb > a[2] and B == -1) {
  19.             B = i;
  20.         }
  21.        
  22.         int tmpc = a[2] + i;
  23.         if(tmpc > a[0] and tmpc > a[1] and C == -1) {
  24.             C = i;
  25.         }
  26.     }
  27.     cout << A << " " << B << " " << C << endl;
  28.     return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement