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 Practicing
- {
- class Program
- {
- static void Main(string[] args)
- {
- double puzel = 2.60;
- double kukla = 3;
- double meche = 4.10;
- double minion = 8.20;
- double kamionche = 2;
- double price = double.Parse(Console.ReadLine());
- int puzelBr = int.Parse(Console.ReadLine());
- int kuklaBr = int.Parse(Console.ReadLine());
- int mecheBr = int.Parse(Console.ReadLine());
- int minionBr = int.Parse(Console.ReadLine());
- int kamionBr = int.Parse(Console.ReadLine());
- int quantity = kuklaBr + mecheBr + kamionBr + puzelBr + minionBr;
- Boolean fiftyOrGreater = quantity >= 50;
- puzel *= puzelBr;
- kukla *= kuklaBr;
- meche *= mecheBr;
- minion *= minionBr;
- kamionche *= kamionBr;
- double total = puzel + kukla + meche + minion + kamionche;
- if (fiftyOrGreater)
- total *= 0.75;
- total *= 0.90;
- if (total >= price)
- {
- double left = total - price;
- Console.WriteLine("Yes! {0:f2} lv left.", left);
- }
- else
- {
- double need = price - total;
- Console.WriteLine($"Not enough money! {need:f2} lv needed.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement