KeepCoding

Fixed

Jan 23rd, 2018
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace beats
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var guests = double.Parse(Console.ReadLine());
  14.             var budget = double.Parse(Console.ReadLine());
  15.  
  16.  
  17.             var priceforKuvert = guests * 20;
  18.             var lastMoney = budget - priceforKuvert;
  19.             var moneyforFoeverki = lastMoney * 0.4;
  20.             var moneyForKids = lastMoney - moneyforFoeverki;
  21.  
  22.  
  23.             if (priceforKuvert < budget)
  24.             {
  25.                 Console.WriteLine($"Yes! {Math.Round(moneyforFoeverki)} lv are for fireworks and {Math.Round(moneyForKids)} lv are for donation." );
  26.             }
  27.  
  28.             if (priceforKuvert > budget)
  29.             {
  30.                 var all = priceforKuvert - budget;
  31.                 Console.WriteLine($"They won't have enough money to pay the covert. They will need {Math.Round(all)} lv more.");
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment