#include<iostream>
using namespace std;
int main()
{
int d = 50;
vector<int>d;
while(d != 2)
d.push_back(d -= 8);
}
int sum = 0;
for(auto &i : d)
sum += i;
cout<<sum;
Решение на C++
#include<iostream>
using namespace std;
int main()
{
int d = 50;
vector<int>d;
while(d != 2)
{
d.push_back(d -= 8);
}
int sum = 0;
for(auto &i : d)
{
sum += i;
}
cout<<sum;
}
Решение на C++