Back
Tach_Mang_Am_Duong.cpp
Save
// Tach_Mang_Am_Duong.cpp #include
using namespace std; void nhap_mang(float a[], int n) { for (int i = 0; i < n; i++) { cout<<"a["<
>a[i]; } } void tach_mang(float a[], float b[], float c[], int n, int &k, int &l) { k = l = 0; for (int i = 0; i < n; i++) { if (a[i] > 0) { b[k] = a[i]; k++; } else if (a[i] < 0) { c[l] = a[i]; l++; } } cout<<"\nMang b:"<
>n; if (n < 1 || n > 30) cout<<"Nhap so nguyen 1 <= n <= 30"<
30); nhap_mang(a,n); tach_mang(a,b,c,n,k,l); return 0; }