SHARE
TWEET

Untitled

a guest Nov 21st, 2019 122 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Осма_задача___примерна_изпитна_задача
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double tripPrice = double.Parse(Console.ReadLine());
  10.             int puzzlesNumber = int.Parse(Console.ReadLine());
  11.             int talkingDollsNumber = int.Parse(Console.ReadLine());
  12.             int teddyBearsNumber = int.Parse(Console.ReadLine());
  13.             int minionsNumber = int.Parse(Console.ReadLine());
  14.             int trucksNumber = int.Parse(Console.ReadLine());
  15.  
  16.             double puzzlePrice = puzzlesNumber * 2.60;
  17.             int talkingDollsPrice = talkingDollsNumber * 3;
  18.             double teddyBearsPrice = teddyBearsNumber * 4.1;
  19.             double minionsPrice = minionsNumber * 8.2;
  20.             int trucksPrice = trucksNumber * 2;
  21.  
  22.             double toysPrice = puzzlePrice + talkingDollsPrice + minionsPrice + teddyBearsPrice + trucksPrice;
  23.             double rent = toysPrice * 0.1;
  24.             double income = toysPrice - rent;
  25.             int toysNumber = puzzlesNumber + talkingDollsNumber + teddyBearsNumber + minionsNumber + trucksNumber;
  26.             if (toysNumber >= 50)
  27.             {
  28.                 income*= 0.75;
  29.             }
  30.             if (income>=tripPrice)
  31.             {
  32.                 double moneyleft = income - tripPrice;
  33.                 Console.WriteLine($"Yes! {moneyleft:f2} lv left.");
  34.             }
  35.             if (income < tripPrice)
  36.             {
  37.                 double moneyleft = tripPrice - income;
  38.                 Console.WriteLine($"Not enough money! {moneyleft:f2} lv needed.");
  39.             }
  40.         }
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top