?>
1. Имена массивов 2. Количество элементов массивов 3. Чему равно значение Num[6]4. Чему равно значение Weekday[2]Num = [45, 78, 3, 9, 23, -12, 67, - 15, 7 54]Weekday = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
Ответы
Код:
using System;
namespace WordsCounter
{
class Bishop
{
private int x, y;
public Bishop(int x, int y)
{
this.x = x;
this.y = y;
}
public bool CanIAttackIt(int x, int y)
{
return Math.Abs(x - y) == Math.Abs(this.x - this.y);
}
}
class Program
{
static void Main(string[] args)
{
var x0 = int.Parse(Console.ReadLine()!);
var y0 = int.Parse(Console.ReadLine()!);
var x = int.Parse(Console.ReadLine()!);
var y = int.Parse(Console.ReadLine()!);
Console.WriteLine((new Bishop(x0, y0)).CanIAttackIt(x, y));
}
}
}