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 ToyShop
- {
- class Program
- {
- static void Main(string[] args)
- {
- var vacantionPrice = double.Parse(Console.ReadLine());
- var puzels = int.Parse(Console.ReadLine());
- var dolls = int.Parse(Console.ReadLine());
- var bears = int.Parse(Console.ReadLine());
- var minions = int.Parse(Console.ReadLine());
- var trucks = int.Parse(Console.ReadLine());
- var total = puzels * 2.60 + dolls * 3 + bears * 4.10 + minions * 8.20 + trucks * 2;
- var totaltoys = puzels + dolls + bears + minions + trucks;
- if (totaltoys >= 50)
- {
- var billoff = total - (total * 0.25);
- var rent = billoff - (billoff * 0.10);
- if (rent >= vacantionPrice)
- {
- var final = rent - vacantionPrice;
- Console.WriteLine("Yes! {0:f2} lv left.", final);
- }
- else{
- var final = vacantionPrice - rent;
- Console.WriteLine($"Not enough money! {final:f2} lv needed.");
- }
- }
- else if(totaltoys < 50)
- {
- var rent2 = total - (total * 0.10);
- if(rent2 <= vacantionPrice)
- {
- var final2 = vacantionPrice - rent2;
- Console.WriteLine("Not enough money! {0:f2} lv needed.", final2);
- }
- else{
- var final2 = rent2 - vacantionPrice;
- Console.WriteLine($"Yes! {final2:f2} lv left.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement