Advertisement
aneliabogeva

Untitled

Apr 6th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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 _Substitute
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string steps = Console.ReadLine();
  14. int totalSteps = int.Parse(steps);
  15.  
  16. while (totalSteps<= 10000)
  17. {
  18.  
  19. steps = Console.ReadLine();
  20. if (steps == "Going home")
  21. {
  22. steps = Console.ReadLine();
  23. totalSteps += int.Parse(steps);
  24. Console.WriteLine($"{10000 - totalSteps} more steps to reach goal.");
  25. break;
  26. }
  27. totalSteps += int.Parse(steps);
  28.  
  29. }
  30. Console.WriteLine($"Goal reached! Good job!");
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement