EvgeniVT

Untitled

Nov 27th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Maiden_Party
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             var mP = decimal.Parse(Console.ReadLine());
  10.             var loveMess = int.Parse(Console.ReadLine());
  11.             var rose = int.Parse(Console.ReadLine());
  12.             var keys = int.Parse(Console.ReadLine());
  13.             var pic = int.Parse(Console.ReadLine());
  14.             var surprise = int.Parse(Console.ReadLine());
  15.             var price = loveMess * 0.6m + rose * 7.2m + keys * 3.6m + pic * 18.2m + surprise * 22m;
  16.             var count = loveMess + rose + keys + pic + surprise;
  17.             if (count >= 25)
  18.                 price *= 0.65m;
  19.             price *= 0.9m;
  20.             if (price >= mP)
  21.                 Console.WriteLine($"Yes! {price - mP:F2} lv left.");
  22.             else
  23.                 Console.WriteLine($"Not enough money! {mP-price:F2} lv needed.");
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment