#include <iostream>
using namespace std;
int main()
{
int a[10];
int sum = 0;
cout << "vvedite elementu massiva" << endl;
for(int i=0;i<10;i=i+1)
cin >> a[i];
cout << endl;
sum = sum + a[i];
cout<< "summa elementov = " << sum << endl;
system("pause");
return 0;
}
Объяснение:
#include <iostream>
using namespace std;
int main()
{
int a[10];
int sum = 0;
cout << "vvedite elementu massiva" << endl;
for(int i=0;i<10;i=i+1)
cin >> a[i];
cout << endl;
for(int i=0;i<10;i=i+1)
sum = sum + a[i];
cout<< "summa elementov = " << sum << endl;
system("pause");
return 0;
}
Объяснение: