Programming Basics
Ако някой ми открива грешката,моля да помогне.
using System;
namespace Pets
{
class Pets
{
static void Main()
{
int days = int.Parse(Console.ReadLine());
int leftFood = int.Parse(Console.ReadLine());
double foodDog = double.Parse(Console.ReadLine());
double foodCat = double.Parse(Console.ReadLine());
double foodTurtle = double.Parse(Console.ReadLine());
double neededFoodDog = days * foodDog;
double neededFoodCat = days * foodCat;
double neededFoodTurtle = (days * foodTurtle )/ 1000;
double sumFood = neededFoodDog + neededFoodCat + neededFoodTurtle ;
double result = Math.Abs(leftFood - sumFood);
if (sumFood <= leftFood)
{
Console.WriteLine("{0} kilos of food left.",Math.Floor(sumFood));
}
else
{
Console.WriteLine("{0} more kilos of food are needed.", Math.Ceiling(sumFood));
}
}
}
}
Не ми излиза точен резултат.
Благодаря!
https://judge.softuni.bg/Contests/354/Programming-Basics-Exam-20-November-2016-Morning
Да,забравих наистина.
02. Pets
https://judge.softuni.bg/Contests/354/Programming-Basics-Exam-20-November-2016-Morning
Ето от мен https://pastebin.com/GN7niVJK
Благодаря на всички за отговорите!