Advertisement
IvanGeorgiev

Untitled

Jun 7th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp19
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int width = int.Parse(Console.ReadLine());
  10. int lenght = int.Parse(Console.ReadLine());
  11. int hight = int.Parse(Console.ReadLine());
  12. int total = lenght * width * hight;
  13. string command = "";
  14. int boxSum = 0;
  15. bool isEnought = false;
  16.  
  17. while (!isEnought)
  18. {
  19. int box = int.Parse(Console.ReadLine());
  20. boxSum += box;
  21. command = Console.ReadLine();
  22.  
  23. if (command == "done")
  24. {
  25. break;
  26. }
  27.  
  28. if (boxSum > total)
  29. {
  30. isEnought = true;
  31. break;
  32. }
  33.  
  34. }
  35.  
  36. if (isEnought)
  37. {
  38. Console.WriteLine("no");
  39. }
  40.  
  41. else
  42. {
  43. Console.WriteLine("yes");
  44. }
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement