Здравейте, искам да попитам относно задачата Волейбол от Programming Basics with C# - ноември 2018
Искам да попитам каква ми е грешката при високосна година
Ето и кода:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Programming_basics
{
class Program
{
static void Main(string[] args)
{
string year = Console.ReadLine();
double p = double.Parse(Console.ReadLine());
double h = double.Parse(Console.ReadLine());
double weekends = 48;
if (year == "leap")
{
weekends = weekends - h;
weekends = weekends * 3 / 4;
double holidays = p * 2 / 3;
double totalGames = weekends + h + holidays;
double yearIsLeap = (15 / 100) * totalGames;
double allGamesInYear = yearIsLeap + totalGames;
Console.WriteLine(Math.Truncate(allGamesInYear));
}
else if (year == "normal")
{
weekends = weekends - h;
weekends = weekends * 3 / 4;
double holidays = p * 2 / 3;
double totalGames = weekends + h + holidays;
Console.WriteLine(Math.Truncate(totalGames));
}
}
}
}