Ответ:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> array;
int i = 0, j, sum = 0;
while (i == 0)
cin >> j;
if (j != 0)
array.push_back(j);
}
else i = 1;
i = array.size();
for (j = 0; j < i; j++)
if (array[j] > 7)
sum += array[j];
cout << array[j] << " ";
cout << endl << "Sum of elements = " << sum << endl;
system("pause");
return 0;
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> array;
int i = 0, j, sum = 0;
while (i == 0)
{
cin >> j;
if (j != 0)
{
array.push_back(j);
}
else i = 1;
}
i = array.size();
for (j = 0; j < i; j++)
{
if (array[j] > 7)
{
sum += array[j];
cout << array[j] << " ";
}
}
cout << endl << "Sum of elements = " << sum << endl;
system("pause");
return 0;
}