Advertisement
Tsenkov

ZadachataSKuklite

Apr 16th, 2024
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp1
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double tripPrice = double.Parse(Console.ReadLine());
  14.             int puzzles = int.Parse(Console.ReadLine());
  15.             double puzzlePrice = 2.60;
  16.             int talkingDolls = int.Parse(Console.ReadLine());
  17.             int bears = int.Parse(Console.ReadLine());
  18.             int minions = int.Parse(Console.ReadLine());
  19.             int trucks = int.Parse(Console.ReadLine());
  20.             int toysTotal = puzzles + talkingDolls + bears + minions + trucks;
  21.             double orderPrice = puzzles * puzzlePrice + talkingDolls * 3 + bears * 4.10 + minions * 8.20 + trucks * 2;
  22.             if (toysTotal >= 50)
  23.             {
  24.                     orderPrice = orderPrice * 0.75;
  25.              }
  26.             double rent = orderPrice * 0.10;
  27.             double myMoney = orderPrice - rent;
  28.             if (myMoney >= tripPrice)
  29.             {
  30.                 Console.WriteLine($"Yes! {myMoney - tripPrice:f2} lv left.");
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine($"Not enough money! {tripPrice - myMoney:f2} lv needed.");
  35.             }
  36.  
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement