#include using namespace std; float tongDuong(float a[], int l, int r) { if (r == l) { if (a[l] > 0) return a[l]; else return 0; } else { int m = (l + r) / 2; return tongDuong(a, l, m) + tongDuong(a, m + 1, r); } } int main() { float a[] = {1.2, 3.4, 4.5, 9.1, 6.3, 7.2, 5.4, 4.6, 4.9, 8.5, 9.9, 0.5, 6, 8, 10.6, -3, 3, 4, -2, -5}; cout << "Tong duong: " << tongDuong(a, 0, 19) << endl; return 0; }