Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Осма_задача___примерна_изпитна_задача
- {
- class Program
- {
- static void Main(string[] args)
- {
- double tripPrice = double.Parse(Console.ReadLine());
- int puzzlesNumber = int.Parse(Console.ReadLine());
- int talkingDollsNumber = int.Parse(Console.ReadLine());
- int teddyBearsNumber = int.Parse(Console.ReadLine());
- int minionsNumber = int.Parse(Console.ReadLine());
- int trucksNumber = int.Parse(Console.ReadLine());
- double puzzlePrice = puzzlesNumber * 2.60;
- int talkingDollsPrice = talkingDollsNumber * 3;
- double teddyBearsPrice = teddyBearsNumber * 4.1;
- double minionsPrice = minionsNumber * 8.2;
- int trucksPrice = trucksNumber * 2;
- double toysPrice = puzzlePrice + talkingDollsPrice + minionsPrice + teddyBearsPrice + trucksPrice;
- double rent = toysPrice * 0.1;
- double income = toysPrice - rent;
- int toysNumber = puzzlesNumber + talkingDollsNumber + teddyBearsNumber + minionsNumber + trucksNumber;
- if (toysNumber >= 50)
- {
- income*= 0.75;
- }
- if (income>=tripPrice)
- {
- double moneyleft = income - tripPrice;
- Console.WriteLine($"Yes! {moneyleft:f2} lv left.");
- }
- if (income < tripPrice)
- {
- double moneyleft = tripPrice - income;
- Console.WriteLine($"Not enough money! {moneyleft:f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement