Ответ:
#include <iostream>
using namespace std;
const int size = 50;
int main() {
int sum=0;
int arr[size] = {-19, -16, -14, -13, -12, -11, -10, -9, -6, -5, -4, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 28, 30, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49};
for (int i=0; i<size; i++ ) {
if (arr[i]>0) sum+=arr[i];
}
cout << sum << endl;
return 0;
Объяснение:
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
using namespace std;
const int size = 50;
int main() {
int sum=0;
int arr[size] = {-19, -16, -14, -13, -12, -11, -10, -9, -6, -5, -4, 0, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 28, 30, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49};
for (int i=0; i<size; i++ ) {
if (arr[i]>0) sum+=arr[i];
}
cout << sum << endl;
return 0;
}
Объяснение: