-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12 Task.cs
More file actions
33 lines (27 loc) · 764 Bytes
/
12 Task.cs
File metadata and controls
33 lines (27 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
public class MainClass
{
public static void Main()
{
int x = 0;
int y = 0;
string input1;
do
{
input1 = Console.ReadLine();
if (input1 == "стоп")
break;
if (input1 == "вправо")
x += 1;
else if (input1 == "влево")
x -= 1;
else if (input1 == "вверх")
y += 1;
else if (input1 == "вниз")
y -= 1;
else
Console.WriteLine("Неизвестная команда!");
}while (true);
Console.WriteLine($"Координаты: {x}, {y}");
}
}