-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask 11.cs
More file actions
33 lines (30 loc) · 1.59 KB
/
Task 11.cs
File metadata and controls
33 lines (30 loc) · 1.59 KB
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()
{
string[] signs = { "камень", "ножницы", "бумага" };
Console.WriteLine("Выбирает первый игрок: 0 - камень, 1 - ножницы, 2 - бумага");
int input1 = int.Parse(Console.ReadLine());
Console.WriteLine($"Первый игрок выбрал: {signs[input1]}");
Console.WriteLine("Выбирает второй игрок: 0 - камень, 1 - ножницы, 2 - бумага");
int input2 = int.Parse(Console.ReadLine());
Console.WriteLine($"Второй игрок выбрал: {signs[input2]}");
if (input1 == input2)
Console.WriteLine($"Результат: Ничья");
else
if (input1 == 0 && input2 == 2)
Console.WriteLine($"Результат: Победил второй игрок");
else
if (input1 == 2 && input2 == 0)
Console.WriteLine($"Результат: Победил первый игрок");
else
if (input1 < input2)
Console.WriteLine($"Результат: Победил первый игрок");
else
if (input1 > input2)
Console.WriteLine($"Результат: Победил второй игрок");
else
Console.WriteLine($"Такого варианта не может быть!");
}
}