#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int N = 5;
double arr[N];
char choice;
double sum = 0;
do
{
cout << "Please, enter 5 values: ";
for (int i = 0; i < N; i++)
{
cin >> arr[i];
}
cout << fixed << setprecision(1);
for (int i = 0; i < N; i++)
{
cout<< arr[i] << " ";
if (i < N - 1)
sum += arr[i];
}
if (sum > arr[N-1])
cout << "\nYes";
cout << "\nDo you want to continue or escape? [Y/N]: ";
cin >> choice;
} while (choice == 'Y');
}
Comments
Leave a comment