Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- double excursion = double.Parse(Console.ReadLine());
- int puzzelsNum = int.Parse(Console.ReadLine());
- int dollNum = int.Parse(Console.ReadLine());
- int bearNum = int.Parse(Console.ReadLine());
- int minionNum = int.Parse(Console.ReadLine());
- int truckNum = int.Parse(Console.ReadLine());
- int toysTotal = puzzelsNum + dollNum + bearNum + minionNum + truckNum;
- double toysPrise = (puzzelsNum * 2.60) + (dollNum * 3) + (bearNum * 4.10) + (minionNum *8.20) + (truckNum * 2);
- double profit = 0;
- double difference = 0;
- if(excursion < toysPrise && toysTotal>=50)
- {
- profit = (toysPrise -0.25 * toysPrise) - (0.1 *(toysPrise -0.25 * toysPrise));
- difference = profit - excursion;
- Console.WriteLine( "Yes! {0:F2} lv left.",difference);
- }
- else if(excursion > toysPrise)
- {
- profit = toysPrise - (0.1 * toysPrise);
- difference = excursion - profit;
- Console.WriteLine( "Not enough money! {0:F2} lv needed.",difference);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement