#include using namespace std; // Tong cac so duong float sum(float a[], int l, int r) { if (l == r) if (a[l] > 0) return a[l]; else return 0; int m = (l + r) / 2; return sum(a, l, m) + sum(a, m + 1, r); } int main() { float a[8] = {1, 3, 4, -9, 6, 7, -5, 4}; cout << sum(a, 0, 7); return 0; }