Проверьте, пожалуйста: найти сумму всех положительных элементов массива А = {-1.2, 3.5, .4.1,8.5, .5.3, -6.1, 3.4, 2.7}
Мой ответ:
#include"stdafx.h"
#include
int main ()
{ const int i;
const int n = 10;
double A [n];
for(i = 0; i < n; ++i)
cin>> A[i];
double S = 0;
for(int i >0; i
S = a[i];
}
system("pause");
return 0;