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