Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- double cenaNaEkskurzia = double.Parse(Console.ReadLine());
- int broiPazeli = int.Parse(Console.ReadLine());
- int govoreshtiKukli = int.Parse(Console.ReadLine());
- int plusheniMecheta = int.Parse(Console.ReadLine());
- int minioni = int.Parse(Console.ReadLine());
- int kamioncheta = int.Parse(Console.ReadLine());
- double cenaPazel = 2.60;
- double cenaKukla = 3;
- double cenaMeche = 4.10;
- double cenaMinion = 8.20;
- double cenaKamion = 2;
- double sumOfProducts = (broiPazeli * cenaPazel) + (govoreshtiKukli * cenaKukla) +
- (plusheniMecheta * cenaMeche) + (minioni * cenaMinion) + (kamioncheta * cenaKamion);
- if ((broiPazeli + govoreshtiKukli + plusheniMecheta + minioni + kamioncheta) >= 50)
- {
- sumOfProducts = sumOfProducts - (0.25 * sumOfProducts);
- }
- sumOfProducts = sumOfProducts - (0.1 * sumOfProducts);
- if (sumOfProducts > cenaNaEkskurzia)
- {
- Console.WriteLine("Yes! {0:F2} lv left.", (Math.Abs(cenaNaEkskurzia - sumOfProducts)));
- }
- else
- {
- Console.WriteLine("Not enough money! {0:F2} lv needed.", (Math.Abs(cenaNaEkskurzia-sumOfProducts)));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement