Advertisement
bacco

Новогодишно парти; New Years Eve Party

Feb 6th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace tESt
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             var guests = int.Parse(Console.ReadLine());
  10.             var budget = double.Parse(Console.ReadLine());
  11.  
  12.             var ticketsPrice = guests * 20;   //400
  13.             var diff = budget - ticketsPrice; // 600
  14.             var fireworks = diff * 0.40;   // = 240 лв
  15.             var donation = diff - fireworks;
  16.  
  17.             if (diff >= 0)
  18.             {
  19.                 Console.WriteLine($"Yes! {fireworks:f0} lv are for fireworks and {donation:f0} lv are for donation. ");
  20.             }
  21.             else
  22.             {
  23.                 diff = Math.Abs(diff);
  24.                 Console.WriteLine($"They won't have enough money to pay the covert. They will need {diff:f0} lv more.");
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement