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 Izpit_2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string start = "";
- string start_1 = Console.ReadLine();
- if (start_1 == "N") start = "North";
- if (start_1 == "E") start = "East";
- if (start_1 == "S") start = "South";
- if (start_1 == "W") start = "West";
- List<string> Dirtections = new List<string>();
- Dirtections.Add("North");
- Dirtections.Add("East");
- Dirtections.Add("South");
- Dirtections.Add("West");
- List<string> Rotated = new List<string>();
- int c = 0;
- for ( ; ; )
- {
- string input = Console.ReadLine();
- if (input == "END") break;
- int a = int.Parse(input);
- int b = a / 45;
- c = c + b;
- // N E S W N E S W
- // [0][1][2][3]
- }
- //Console.WriteLine(c);
- for (int i = 0; i < 250; i++)
- {
- for (int j = 0; j < Dirtections.Count; j++)
- {
- Rotated.Add(Dirtections[j]);
- }
- }
- if (c >= 0)
- {
- for (int i = 0; i < Rotated.Count; i++)
- {
- if (Rotated[i] == start)
- {
- Console.WriteLine($"Starting Position: {Rotated[i]}");
- Console.WriteLine($"Position After Rotating: {Rotated[i + c]}");
- break;
- }
- }
- }
- else
- {
- for (int i = Rotated.Count - 1; i > 0; i--)
- {
- if (Rotated[i] == start)
- {
- Console.WriteLine($"Starting Position: {Rotated[i]}");
- Console.WriteLine($"Position After Rotating: {Rotated[i+ c]}");
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement