anizko

12. Toy Shop

Apr 1st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Toy_Shop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double PriceHoliday = double.Parse(Console.ReadLine());
  10.  
  11.             int CountPazel = int.Parse(Console.ReadLine());
  12.             int CountKukla = int.Parse(Console.ReadLine());
  13.             int CountMeche = int.Parse(Console.ReadLine());
  14.             int CountMinion = int.Parse(Console.ReadLine());
  15.             int CountKamion = int.Parse(Console.ReadLine());
  16.  
  17.          
  18.             double OstavashiPari = 0;
  19.             double NedostatachnoPari = 0;
  20.  
  21.             double ProdadeniIgrackiLv = (CountPazel * 2.6) +
  22.                 (CountKukla * 3) + (CountMeche * 4.1) +
  23.                 (CountMinion * 8.2) + (CountKamion * 2);
  24.             double ProdadeniIgrackiCount = CountPazel + CountKukla + CountMeche +
  25.                 CountMinion  + CountKamion ;
  26.  
  27.  
  28.             if (ProdadeniIgrackiCount >=50)
  29.             {
  30.                 ProdadeniIgrackiLv = ProdadeniIgrackiLv-(ProdadeniIgrackiLv*25/100);
  31.                 ProdadeniIgrackiLv = ProdadeniIgrackiLv- (ProdadeniIgrackiLv * 10 / 100);
  32.             }
  33.             else
  34.             {
  35.                 ProdadeniIgrackiLv = ProdadeniIgrackiLv - (ProdadeniIgrackiLv * 10 / 100);
  36.             }
  37.  
  38.             if (PriceHoliday <= ProdadeniIgrackiLv)
  39.             {
  40.                 OstavashiPari =  ProdadeniIgrackiLv - PriceHoliday;
  41.                 Console.WriteLine($"Yes! {OstavashiPari:f2} lv left.");
  42.             }
  43.             else
  44.             {
  45.                 NedostatachnoPari =  PriceHoliday- ProdadeniIgrackiLv;
  46.                 Console.WriteLine($"Not enough money! {NedostatachnoPari:f2} lv needed.");
  47.             }
  48.  
  49.  
  50.            
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment