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