ответ
Объяснение:
#include <iostream>
using namespace std;
int main()
{
int num, sum = 0, temp;
cin >> num;
sum += num;
temp = num + 1;
while (true)
if (num > temp) break;
temp = num;
}
cout << "Sum = " << sum;
ответ
Объяснение:
#include <iostream>
using namespace std;
int main()
{
int num, sum = 0, temp;
cin >> num;
sum += num;
temp = num + 1;
while (true)
{
cin >> num;
if (num > temp) break;
temp = num;
sum += num;
}
cout << "Sum = " << sum;
}