hpnq

МАТФАК ИМИМФИ

Nov 1st, 2023 (edited)
886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include "bits/stdc++.h"
  2. //speed coding
  3.  
  4. #define loop(i, x, n) for (int i = x; i < n; i++)
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.     ios::sync_with_stdio(0);
  11.     cin.tie(0);
  12. #ifdef DEBUG
  13.     freopen("text.txt", "r", stdin);
  14. #endif
  15. // 7
  16.     const int n = 5;
  17.     double b[n];
  18.     loop(i, 0, n) cin >> b[i];
  19.     int j = 0;
  20.     loop(i, 0, n){
  21.         if(b[i] == 0){
  22.             swap(b[i], b[j]);
  23.             j++;
  24.         }
  25.     }
  26.     for(auto i : b){
  27.         cout << i << " ";
  28.     }
  29.     cout << "\n";
  30. // max(1, 2, 3)
  31.     int a1, a2, a3;
  32.     cin >> a1 >> a2 >> a3;
  33.     cout << (a1 > a2 ?( a1 >= a3 ? a1 : a3 ):( a2 >= a3 ? a2 : a3));
  34.  
  35.     return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment