Код:
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));
}
}
}
Код:
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));
}
}
}
i:integer;
s:string;
const
glas=['Й','У','Е','Ы','А','О','Э','Я','И','Ю'];
beginwrite ('Vvedite predlohenie: ');
readln (s);
i:=1;
while i<=length (s) do
begin
if ((i=1) or (s[i-1]=' ')) and (s[i] in glas) then
begin
while not ((s[i] in ['.',',',';','!','?',':',' '])) and (i<=length (s)) do
begin
write (s[i]);
i:=i+1;
end;
writeln;
end;
i:=i+1;
end;
readln;
end.