Ski Trip C#
Здравейте,
тази задача дава 2 грешки при постването в judge на Test 1 и Test 10 без обяснение. Ако някой може да погледне и да каже от къде може да идват :)
https://pastebin.com/F4pJWZEj
Здравейте,
тази задача дава 2 грешки при постването в judge на Test 1 и Test 10 без обяснение. Ако някой може да погледне и да каже от къде може да идват :)
https://pastebin.com/F4pJWZEj
Кода е много голям и неуспявам да схвана логиката. Ето ти моето решение да сравниш, гешката ще се покаже
using System;
namespace _4._9._10Ski_Trip
{
class Program
{
static void Main(string[] args)
{
int ddni = int.Parse(Console.ReadLine());
string pomeshtenie = Console.ReadLine();
string ochenka = Console.ReadLine();
double prestoi = 0;
double ostypka = 0;
double dni =ddni- 1;
if (pomeshtenie == "room for one person")
{
ostypka = dni * 18.00;
}
else if (pomeshtenie == "apartment")
{
prestoi = dni * 25.00;
if (dni>0 && dni <= 10)
{
ostypka = prestoi - (prestoi * 0.30);
}
else if (dni > 10 && dni <= 15)
{
ostypka = prestoi - (prestoi * 0.35);
}
else if (dni > 15)
{
ostypka = prestoi - (prestoi * 0.50);
}
}
else if (pomeshtenie == "president apartment")
{
prestoi = dni * 35.00;
if (dni > 0 && dni <= 10)
{
ostypka = prestoi - (prestoi * 0.10);
}
else if (dni > 10 && dni <= 15)
{
ostypka = prestoi - (prestoi * 0.15);
}
else if (dni > 15)
{
ostypka = prestoi - (prestoi * 0.20);
}
//346
}
if (ochenka == "positive")
{
double bakshish = ostypka + (ostypka * 0.25);
Console.WriteLine($"{bakshish:F2}");
}
else if (ochenka == "negative")
{
double bakshish = ostypka - (ostypka * 0.10);
Console.WriteLine($"{bakshish:F2}");
}
}
}
}
Extremely intriguing online journal. A lot of web journals I see nowadays don't generally give anything that I'm keen on, however I'm most definitely inspired by this one. Recently felt that I would post and let you know. https://royalcbd.com/product/cbd-oil-2500mg/
Едно решение и от мен. Стана малко дълъг код, но цялата логика си я направих изцяло сам без да гледам от никъде, като след доста опити успях да чукна 100/100 :) (дебъгването помага много при хващането на грешките)
https://pastebin.com/3YNMrMcw
using System;
namespace ConsoleApp6
{
class Program
{
static void Main(string[] args)
{
double days = double.Parse(Console.ReadLine());
string room = Console.ReadLine();
string e = Console.ReadLine();
double price = 0.0;
double totalprice = 0.0;
double totalprice2 = 0.0;
if (room == "room for one person")
{
price = 18.00;
if (e == "positive")
{
totalprice = (days-1) * price + (days-1) * price * 0.25;
Console.WriteLine("{0:F2}", totalprice);
}
else if (e == "negative")
{
totalprice = (days-1) * price - (days-1) * price * 0.10;
Console.WriteLine("{0:F2}", totalprice);
}
}
else if (room == "apartment")
{
price = 25.00;
if (e == "positive")
{
if (days < 10)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.30;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
else if (days >= 10 && days <= 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.35;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
else if (days > 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.50;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
}
else if (e == "negative")
{
if (days < 10)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.30;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
else if (days >= 10 && days <= 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.35;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
else if (days > 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.50;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
}
}
else if (room == "president apartment")
{
price = 35.00;
if (e == "positive")
{
if (days < 10)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.10;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
else if (days >= 10 && days <= 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.15;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
else if (days > 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.20;
Console.WriteLine("{0:F2}", (totalprice + totalprice * 0.25));
}
}
else if (e == "negative")
{
if (days < 10)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.10;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
else if (days >= 10 && days <= 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.15;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
else if (days > 15)
{
totalprice2 = (days - 1) * price; totalprice = totalprice2 - totalprice2 * 0.20;
Console.WriteLine("{0:F2}", (totalprice - totalprice * 0.10));
}
}
}
}
}
}
Ето едно решение и от мен, самоделно :)
A detailed answer is inquired for the identification of goals for people. Mutual way of the term and essayedge.com reviews is chalked out for humans. The target of health and fitness is improved for all goals for people. The assignment is filled with the tips and moves for humans. challenge is argued with the help of approachable means for all good signs for people.
There is nothing more fun than an old-fashioned road trip. Now, I've been a "road tripper" for some time and though all u can eat breakfast buffet near me I love air travel, I love road trips because you can really experience the country as you drive to your destination and soak up the local flavors along the way.
This concise article will examine the idea of a pressure crack and how to treat this finding. One such route is to best hand doctor near me utilize well-made support that can assist you with advancing the mending procedure. We will talk about additional in this article.