- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
using System;
using System.Linq;
using s = System.String;
using i = System.Int32;
class Player
{
static i sgn(i x) => x < 0 ? -1 : x > 0 ? 1 : 0;
static s g(ref i z, i Z, s S)
{
i t = sgn(z - Z);
if (t < 0) z++;
else if (t > 0) z--;
return S[t + 1] + "";
}
static void Main()
{
var a = Console.ReadLine().Split().Select(i.Parse).ToArray();
i X = a[0], Y = a[1], x = a[2], y = a[3];
while (true)
{
Console.ReadLine();
Console.WriteLine(g(ref y, Y, "S N") + g(ref x, X, "E W"));
}
}
}
Поиск пути на плоскости от первой точки координат до второй. Выводит направление следующего передвижения.