Advertisement
Guest User

Untitled

a guest
Sep 15th, 2018
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ToyShop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double priceEscursion = double.Parse(Console.ReadLine());
  14. int puzzles = int.Parse(Console.ReadLine());
  15. int talkingDolls = int.Parse(Console.ReadLine());
  16. int teddyBears = int.Parse(Console.ReadLine());
  17. int minions = int.Parse(Console.ReadLine());
  18. int trucks = int.Parse(Console.ReadLine());
  19.  
  20. double totalAmount = puzzles * 2.6 + talkingDolls * 3 + teddyBears * 4.1 + minions * 8.2 + trucks * 2;
  21.  
  22. if ((puzzles + talkingDolls + teddyBears + minions + trucks) > 50)
  23. {
  24. totalAmount = totalAmount - totalAmount * 25 / 100;
  25. }
  26.  
  27. totalAmount = totalAmount - totalAmount * 10 / 100;
  28.  
  29. if (totalAmount < priceEscursion)
  30. {
  31. Console.WriteLine($"Not enough money! {(priceEscursion - totalAmount):F2} lv needed.");
  32. }
  33. else
  34. {
  35. Console.WriteLine($"Yes! {(totalAmount - priceEscursion):F2} lv left.");
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement