Guest User

Untitled

a guest
Oct 21st, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. double exkurzia = double.Parse(Console.ReadLine());
  8. int broipazeli = int.Parse(Console.ReadLine());
  9. int broikukli = int.Parse(Console.ReadLine());
  10. int broimecheta = int.Parse(Console.ReadLine());
  11. int broiminioni = int.Parse(Console.ReadLine());
  12. int broikamioncheta = int.Parse(Console.ReadLine());
  13. int AllbroiIgrachki = broipazeli + broikukli + broimecheta + broiminioni + broikamioncheta;
  14. double allSum = broipazeli * 2.6 + broikukli * 3 + broimecheta * 4.10 + broiminioni * 8.2 + broikamioncheta * 2;
  15. double otstapka = 0;
  16. double krainaCena = 0;
  17. double naem = 0;
  18. double pechalba = 0;
  19.  
  20. if (AllbroiIgrachki >= 50)
  21. {
  22. otstapka = allSum * 0.25;
  23. krainaCena = allSum - otstapka;
  24. naem = krainaCena * 0.10;
  25. pechalba = krainaCena - naem;
  26. }
  27. else
  28. {
  29. naem = allSum * 0.1;
  30. pechalba = allSum - naem;
  31. }
  32. if (pechalba >= exkurzia)
  33. {
  34. double ostavastiPari = pechalba - exkurzia;
  35. Console.WriteLine("Yes! {0:F2} lv left.", ostavastiPari);
  36. }
  37. else
  38. {
  39. double nedostigastiPari = exkurzia - pechalba;
  40. Console.WriteLine("Not enough money! {0:F2} lv needed.", nedostigastiPari);
  41. }
  42. }
  43. }
RAW Paste Data