Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numberguests = int.Parse(Console.ReadLine());
- int budget = int.Parse(Console.ReadLine());
- int kuvert = 20;
- double kuvertAmount = numberguests * kuvert;
- double moneyLeft = budget - kuvertAmount;
- double moneyFire = moneyLeft * 0.4;
- double moneyCharity = moneyLeft - moneyFire;
- if (budget > kuvertAmount)
- {
- Console.WriteLine("Yes! {0} lv are for fireworks and {1} lv are for donation.", Math.Round(moneyFire), Math.Round(moneyCharity));
- }
- else if (budget <= kuvertAmount)
- {
- Console.WriteLine("They won't have enough money to pay the covert. They will need {0} lv more.", Math.Abs(Math.Round(moneyLeft)));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement