Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <cstring>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- vector <int> Vector_aleshe_ban(n);
- int number;
- for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
- {
- cin >> Vector_aleshe_ban[i];
- }
- for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
- {
- for (int i = 1; i < n; i++)
- {
- if (Vector_aleshe_ban[i] < Vector_aleshe_ban[i - 1])
- {
- swap(Vector_aleshe_ban[i], Vector_aleshe_ban[i - 1]);
- }
- }
- }
- for (int i = 0; i < (int)Vector_aleshe_ban.size(); i++)
- {
- cout << Vector_aleshe_ban[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement