#include "stdafx.h" #include <iostream> using namespace std;
int main() { int i; int sum = 0; const int size = 10; int main_mass[size]; for (i = 0; i < size; i++) { cout << "Enter the number " << i << " of " << size << " : "; cin >> main_mass[i]; sum += main_mass[i]; }; cout << "Summa vseh elementov massiva = " << sum << " "; system("pause"); }
int m[10], sum;
for(int i=0; i<10; i++){
sum+=m[i];
}
}
#include <iostream>
using namespace std;
int main()
{
int i;
int sum = 0;
const int size = 10;
int main_mass[size];
for (i = 0; i < size; i++) {
cout << "Enter the number " << i << " of " << size << " : ";
cin >> main_mass[i];
sum += main_mass[i];
};
cout << "Summa vseh elementov massiva = " << sum << " "; system("pause");
}