Computer Room
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main()
{
string month, time; int hours, people; double t_hours, h = 0;
cin >> month >> hours >> people >> time;
if (time == "day")
{
if (month == "march" || month == "april" || month == "may")
{
t_hours = 10.50; h = 10.50;
}
else {
t_hours = 12.60; h = 12.60;
}
}
else if (time == "night")
{
if (month == "march" || month == "april" || month == "may")
{
t_hours = 8.40; h = 8.40;
}
else {
t_hours = 10.20; h = 10.20;
}
}
if (people >= 4)
{
h -= h * 0.1;
}
if (hours >= 5)
{
h -= h * 0.5;
}
double price = (h * people) * hours;
cout.setf(ios::fixed);
cout.precision(2);
cout << "Price per person for one hour: " << h << endl;
cout << "Total cost of the visit: " << price;
}
, Дава ми 80/100. Не мога да разбера защо..
случайно някой да я има и за java basic ?