Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2018
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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. namespace Water_dispenser
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int volumOfGlass = int.Parse(Console.ReadLine());
  13. int totalSum = 0;
  14. int times = 0;
  15. while (totalSum<volumOfGlass)
  16. {
  17. string input = Console.ReadLine().ToLower() ;
  18. if (input == "easy")
  19. totalSum += 50;
  20. if (input == "medium")
  21. totalSum += 100;
  22. if (input == "hard")
  23. totalSum += 200;
  24. times++;
  25. }
  26. if (totalSum > volumOfGlass)
  27. {
  28. Console.WriteLine($"{totalSum - volumOfGlass}ml has been spilled.");
  29. return;
  30. }
  31. Console.WriteLine($"The dispenser has been tapped {times} times.");
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement