Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _12PeyToyShopMe
- {
- class Program
- {
- static void Main(string[] args)
- {
- double tripPrice = double.Parse(Console.ReadLine());
- int puzzels = int.Parse(Console.ReadLine());
- int talkingDolls = int.Parse(Console.ReadLine());
- int teddybears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double totalSum = puzzels * 2.60 + talkingDolls * 3.0 + teddybears * 4.10 + minions * 8.20 + trucks * 2.0;
- double toysCount = puzzels + talkingDolls + teddybears + minions + trucks;
- double discount = totalSum * 0.25;
- discount = totalSum - discount;
- if (toysCount > 50)
- {
- discount = totalSum - discount;
- }
- else if (toysCount < 50)
- {
- discount = 0;
- }
- double endPrice = totalSum - discount;
- double rent = endPrice * 0.1;
- double earning = endPrice - rent;
- if (earning > tripPrice)
- {
- double leftmoney = earning - tripPrice;
- Console.WriteLine("Yes! {0:f2} lv left.", leftmoney);
- }
- else if (earning < tripPrice)
- {
- double moneyneeded = tripPrice - earning;
- Console.WriteLine("Not enough money! {0:f2} lv needed.", moneyneeded);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement