toyShop
имам грешка някъде, която не откривам. Моля за малко помощ
#include <iostream>
using namespace std;
int main()
{
double price;
cin >> price;
int numberPuzzle, numberDolls, numberBears, numberMinions, numberTracks;
cin >> numberPuzzle >> numberDolls >> numberBears >> numberMinions >> numberTracks;
double sum = (numberPuzzle * 2.6) + (numberDolls * 3.0) + (numberBears * 4.1) + (numberMinions * 8.2) + (numberTracks * 2.0);
int sumToys = numberPuzzle + numberDolls + numberBears + numberMinions + numberTracks;
double discount = 0.0;
if(sumToys >= 50)
{
discount = (sum * 25) / 100;
}
double totalPrice = sum - discount;
totalPrice = totalPrice - (totalPrice * 0.10);
double finalSum = 0.0;
cout.setf(ios::fixed);
cout.precision(2);
if(totalPrice > price)
{
finalSum = totalPrice - price;
cout << "Yes! " << finalSum << " lv left.";
}
else
{
finalSum = price - totalPrice;
cout << "Not enough money! " << finalSum << " lv needed.";
}
return 0;
}