Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace HelloSoftUni
- {
- class Program
- {
- static void Main(string[] args)
- {
- int steps = 0;
- while(steps < 10000)
- {
- string input = Console.ReadLine();//<-------------
- if (input == "Going home")
- {
- input = Console.ReadLine();
- steps += int.Parse(input);
- break;
- }
- steps += int.Parse(input);//<----------------
- }
- if (steps >= 10000)
- {
- Console.WriteLine($"Goal reached! Good job!{steps - 10000} steps over the goal!");
- }
- else
- Console.WriteLine($"{10000 - steps} more steps to reach the goal.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement