Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

kkaraivanov avatar kkaraivanov 486 Точки

Здравей. Много дълъг код с много ифове.....съжалявам, нямам време за анализ и затова ти пействам примерно решение за сравнение и намиране на грешката

{
    class Program
    {
        static void Main(string[] args)
        {
            string fuelType = Console.ReadLine(); // "Diesel", "Gasoline", "Gas"
            double litersFuel = double.Parse(Console.ReadLine());
            string clubCard = Console.ReadLine(); // "Yes", "No"

            bool chekCard = true;

            if (clubCard == "No")
            {
                chekCard = false;
            }
            else if(clubCard == "Yes")
            {
                chekCard = true;
            }

            double diesel = 2.33;
            double dieselDiscount = 0.12;
            double gasoline = 2.22;
            double gasolineDiscount = 0.18;
            double gas = 0.93;
            double gasDiscount = 0.08;

            if (chekCard)
            {
                diesel -= dieselDiscount;
                gasoline -= gasolineDiscount;
                gas -= gasDiscount;
            }

            double fuelPrice = 0.0;
            double discount20 = 0.08;
            double discount25 = 0.10;

            switch (fuelType)
            {
                case "Diesel":
                    fuelPrice = diesel * litersFuel;
                    break;
                case "Gasoline":
                    fuelPrice = gasoline * litersFuel;
                    break;
                case "Gas":
                    fuelPrice = gas * litersFuel;
                    break;
                default:
                    Console.WriteLine("Invalid fuel!");
                    break;
            }

            if (litersFuel >= 20 && litersFuel <= 25)
            {
                fuelPrice = fuelPrice - (fuelPrice * discount20);
            }
            else if (litersFuel > 25)
            {
                fuelPrice = fuelPrice - (fuelPrice * discount25);
            }
            Console.WriteLine($"{fuelPrice:f2} lv.");
        }
    }
}

 

0
tommysam94 avatar tommysam94 0 Точки

Big Moss Portability - Great For Your Home, Office, Or On The Go.
Big Moss indoor putting vegetables are light-weight and transportable, and may be setup in minutes, making them best for your own home or workplace.
The almost indestructible material is good for coping with the capacity of wear and tear in any location. Do check:  big moss augusta putting green reviews

If you need to keep the placing green after use, just roll it up and put it away till the subsequent time. Big Moss placing surfaces are designed with wrinkle-unfastened cloth, so that you can relaxation smooth understanding your putting green might be fine and stage next time you unroll it.

0
20/10/2020 22:07:47
Nedqlkov91 avatar Nedqlkov91 2 Точки

Все още не мога да намеря грешките в моя код. Най-лесно е да copy paste-a, но нищо няма да съм научил. Благодаря все пак. :)

0
adisongreen avatar adisongreen 0 Точки

What is the exceptional FPS intention instructor?

KovaaK 2.0 is one of the maximum well-known intention trainers inside the marketplace. Used by way of execs like EiiGE, a CS:GO participant for Team Liquid, KovaaK 2.0 comes pre-loaded with over four,000 situations. It additionally includes guided schooling classes and performance analysis equipment, making it easier for new gamers to song their technique. https://lisanilssonart.com/degrees-of-lewdity-free-download/

 

Trusted by way of lots of gamers which include modern and previous execs, KovaaK 2.0 is the definitive FPS training software. With customizable playlists, 5,500+ eventualities, guided education, overall performance analysis, sensible physics, and extra, it's never been less difficult to end up a human aimbot!

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.