Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- static void Main(string[] args)
- {
- double vacationCost = double.Parse(Console.ReadLine());
- int puzzles = int.Parse(Console.ReadLine());
- int dolls = int.Parse(Console.ReadLine());
- int teddyBears = int.Parse(Console.ReadLine());
- int minions = int.Parse(Console.ReadLine());
- int trucks = int.Parse(Console.ReadLine());
- double sum = (puzzles * 2.6) + (dolls * 3) + (teddyBears * 4.1) + (minions * 8.2) + (trucks * 2);
- int howManyToys = puzzles + dolls + teddyBears + minions + trucks;
- double totalPrice = sum;
- if (howManyToys >= 50)
- {
- totalPrice *= 0.75;
- }
- totalPrice *= 0.9;
- if (vacationCost <= totalPrice)
- {
- Console.WriteLine("Yes! {0:f2} lv left.", totalPrice - vacationCost);
- }
- else
- {
- Console.WriteLine("Not enough money! {0:f2} lv needed.", Math.Abs(totalPrice - vacationCost));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement