Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <cstring>
  5. using namespace std;
  6. int main()
  7. {
  8.     int n;
  9.     cin >> n;
  10.     vector <int> Vector_aleshe_ban(n);
  11.     int number;
  12.     for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
  13.     {
  14.         cin >> Vector_aleshe_ban[i];
  15.     }
  16.     for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
  17.     {
  18.         for (int i = 1; i < n; i++)
  19.         {
  20.             if (Vector_aleshe_ban[i] < Vector_aleshe_ban[i - 1])
  21.             {
  22.                 swap(Vector_aleshe_ban[i], Vector_aleshe_ban[i - 1]);
  23.             }
  24.         }
  25.     }
  26.     for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
  27.     {
  28.         cout << Vector_aleshe_ban[i] << " ";
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement