Back
Sap_Xep_Chan_Le.cpp
Save
// Sap_Xep_Chan_Le.cpp #include
using namespace std; void nhap_mang(int a[], int n) { for (int i = 0; i < n; i++) { cout<<"a["<
>a[i]; } } void tim_vi_tri(int a[], int n) { for (int i = 0; i < n; i++) { if (a[i] % 2 == 0 && a[i] % 3 == 0) { cout<<"So "<
0; i--) { for (int j = i-1; j >= 0; j--) { if (a[i] > a[j] && a[j] % 2 != 0) { tam = a[i]; a[i] = a[j]; a[j] = tam; } } } cout<<"Mang sau khi sap xep: "<
>n; if (n < 1 || n > 30) cout<<"Nhap so nguyen 1 <= n <= 30"<
30); nhap_mang(a,n); tim_vi_tri(a,n); sap_xep(a,n); return 0; }