Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int n;
- cout << "nhap n :";
- cin >> n;
- int *a = new int[n];
- for (int i = 0; i < n; i++) {
- cout << "nhap a[" << i + 1 << "]";
- cin >> a[i];
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- if (a[i] > a[j]) {
- int luu = a[i];
- a[j] = a[i];
- a[i] = luu;
- cout << a[j];
- }
- }
- }
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement