05. Cruise Games от изпитните задачи. Не успях да намеря липсващите ми 30 точки...
using System;
//05. Cruise Games от изпитните задачи. Не успях да го докарам 100/100
// максимално ми дава 70/100
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string namePlayer = Console.ReadLine();
int countGames = int.Parse(Console.ReadLine());
double tempPointVolley = 0;
double tempPointTenis = 0;
double tempPointBadminton = 0;
double sumGameVoley = 0;
double sumGameTenis = 0;
double sumGameBadm = 0;
for (int i = 0; i < countGames; i++)
{
string nameGame = Console.ReadLine();
double countPoints = double.Parse(Console.ReadLine());
if (nameGame == "volleyball")
{
tempPointVolley = countPoints * 1.07;
sumGameVoley += tempPointVolley;
}
else if (nameGame == "tennis")
{
tempPointTenis = countPoints * 1.05;
sumGameTenis += tempPointTenis;
}
else if (nameGame == "badminton")
{
tempPointBadminton = countPoints * 1.02;
sumGameBadm += tempPointBadminton;
}
}
double sumPoint = Math.Floor(sumGameVoley + sumGameTenis + sumGameBadm);
double srednoaritmeticno = Math.Floor(sumPoint / countGames);
if (srednoaritmeticno >= 75)
{
Console.WriteLine($"Congratulations, {namePlayer}! You won the cruise games with {sumPoint} points.");
}
else
{
Console.WriteLine($"Sorry, {namePlayer}, you lost. Your points are only {sumPoint}.");
}
}
}
}
Благодаря, за разяснението. Явно не чета внимателно условията :)