1)
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
int num = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(num % 2 == 0 ? "Чётное" : "Нечётное");
Console.WriteLine(num / 10 + num % 10);
}
}
}
2)
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
double[] seconds = new double[8];
string[] athletes = new string[8];
double sum = 0;
double maxN = 0;
int max = 0;
for (int i = 0; i < 8; i++)
{
Console.WriteLine($"Введите фамилию {i + 1}-го участника и его результат: ");
athletes[i] = Console.ReadLine();
seconds[i] = Convert.ToDouble(Console.ReadLine());
sum += seconds[i];
if (seconds[i] > maxN)
{
maxN = seconds[i];
max = i;
}
}
Console.WriteLine($"\n\nСредний результат участников - {sum / 8}");
Console.WriteLine($"Лучший результат у участника с фамилией {athletes[max]} - {maxN}");
}
}
}
1)
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
int num = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(num % 2 == 0 ? "Чётное" : "Нечётное");
Console.WriteLine(num / 10 + num % 10);
}
}
}
2)
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
double[] seconds = new double[8];
string[] athletes = new string[8];
double sum = 0;
double maxN = 0;
int max = 0;
for (int i = 0; i < 8; i++)
{
Console.WriteLine($"Введите фамилию {i + 1}-го участника и его результат: ");
athletes[i] = Console.ReadLine();
seconds[i] = Convert.ToDouble(Console.ReadLine());
sum += seconds[i];
if (seconds[i] > maxN)
{
maxN = seconds[i];
max = i;
}
}
Console.WriteLine($"\n\nСредний результат участников - {sum / 8}");
Console.WriteLine($"Лучший результат у участника с фамилией {athletes[max]} - {maxN}");
}
}
}
x,y: real;
end;
var vc: array [1..4] of point;
bg,nd: point;
i,j,k,m: integer;
begin writeln('координаты точек - через пробел ');
for i:=1 to 4 do
begin
write('точка ',i,' ');
readln(vc[i].x,vc[i].y);
end;
{ сравнение векторов }
m:=0;
for i:=2 to 4 do
begin
bg.x:=vc[i].x-vc[1].x;
bg.y:=vc[i].y-vc[1].y;
j:=1; k:=1;
while ((j=1) or (j=i)) do j:=j+1;
while ((k=1) or (k=i) or (k=j)) do k:=k+1;
nd.x:=vc[j].x-vc[k].x;
nd.y:=vc[j].y-vc[k].y;
if ((bg.x=nd.x) and (bg.y=nd.y)) or
((bg.x=-nd.x) and (bg.y=-nd.y)) then
begin
m:=1;
break;
end;
end;
if m=1 then writeln('точки образуют параллелограмм')
else writeln('точки не образуют параллелограмм');
end.