include iostream int main int cout Vvedite kol-vo el-tov cin int ineg

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include <iostream.h>
int main() {
int n;
cout << "Vvedite kol-vo el-tov";
cin >> n;
int i, ineg;
float sum *a=new float [n];
cout << " Vvedite el-ty massiva";
for (i=0; i<n; i++) cin >> a;
for (i=0; i<n; i++) cout << a << ' ';
for (i=0; i<n; i++) if (a<0) ineg = i;
for (sum=0, i=ineg+1; i<n; i++) sum += a
cout << " Summa " << sum << "\n\n";
return 0;
}