spasnikolov131

Untitled

Jun 15th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. using System;
  2. using System.Linq.Expressions;
  3.  
  4. namespace Add_Bags
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. int hight = int.Parse(Console.ReadLine());
  11. int length = int.Parse(Console.ReadLine());
  12. int percentage = int.Parse(Console.ReadLine());
  13.  
  14. const int walls = 4;
  15. double totalCover = 0;
  16. int count = 0;
  17.  
  18. totalCover = hight * length * walls;
  19. totalCover -= totalCover * (percentage * 0.01);
  20.  
  21.  
  22.  
  23. while (true)
  24. {
  25. string line = Console.ReadLine();
  26. count = int.Parse(line);
  27.  
  28. if (line == "Tired!")
  29. {
  30. break;
  31. }
  32.  
  33.  
  34. totalCover -= count;
  35.  
  36.  
  37. }
  38. Console.WriteLine(totalCover);
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment