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