Programming Basics Online Exam - 15 and 16 June 2019, задача: 05. Series
https://softuni.bg/downloads/svn/programming-basics-v4/course-directories/september-2019/2019-04/Exam/05.%20Series.pdf
Програмата ми работи коректно, но когато я тествам в judge ми изписва: "Грешка при компилация". Някой може ли да ми помогне?
int main()
{
double budget;
cin >> budget;
int numbSeries;
cin >> numbSeries;
for (int i = 0; i < numbSeries; i++)
{
cin.ignore();
string nameSerie;
getline(cin, nameSerie);
double priceSerie;
cin >> priceSerie;
/*Thrones – 50 %
Lucifer – 40 %
Protector – 30 %
TotalDrama – 20 %
Area – 10 %*/
if (nameSerie == "Thrones")
{
priceSerie *= 0.5;
}
else if (nameSerie == "Lucifer")
{
priceSerie *= 0.6;
}
else if (nameSerie == "Protector")
{
priceSerie *= 0.7;
}
else if (nameSerie == "TotalDrama")
{
priceSerie *= 0.8;
}
else if (nameSerie == "Area")
{
priceSerie *= 0.9;
}
budget -= priceSerie;
}
if (budget < 0)
{
cout.setf(ios::fixed);
cout.precision(2);
cout << "You need " << abs(budget) << " lv. more to buy the series!" << endl;
}
else
{
cout.setf(ios::fixed);
cout.precision(2);
cout << "You bought all the series and left with " << budget << " lv." << endl;
}
return 0;
}