Advertisement
Stan0033

Untitled

Apr 6th, 2021
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace steps
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int steps_goal = 10_000;
  10. int steps = 0;
  11. int steps_left = 0;
  12. int steps_over = 0;
  13.  
  14. string input = string.Empty;
  15. int Steps_To_Home = 0;
  16.  
  17. while (steps < 10000)
  18. {
  19. input = Console.ReadLine();
  20. steps += int.Parse(input);
  21. //-----------------------------------------
  22. //-----------------------------------------
  23. if (input == "Going Home")
  24. {
  25. Steps_To_Home = int.Parse(Console.ReadLine());
  26. steps += Steps_To_Home;
  27. }
  28. //-----------------------------------------
  29. //-----------------------------------------
  30.  
  31. steps_left = steps_goal - steps;
  32.  
  33.  
  34. //-----------------------------------------
  35. //-----------------------------------------
  36.  
  37.  
  38. }
  39.  
  40. steps_over = steps - steps_goal; Console.WriteLine($"Goal reached! Good job!\n{steps_over} steps over the goal!");
  41.  
  42. //-----------------------------------------
  43. //-----------------------------------------
  44. }
  45. }
  46. }
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement