<span>const N=30;
var
a: array [1..N] of integer;
i, j, min, min2, s: integer;
begin
for i:=1 to N do readln(a[i]);
for i:=1 to N do bein
for j:=1 to N do begin
if (a[min]-a[mim2] < a[i]-a[j]) then bein
min1 = i;
min2 = j;
end;
end;
end;
Если я конечно правильно задание понял)</span>
Using System;
public class Test
{
public static void Main()
{
double r, x, y;
Console.WriteLine("r = ");
r = double.Parse(Console.ReadLine());
Console.WriteLine("x = ");
x = double.Parse(Console.ReadLine());
if (x<=0) y = -0.5*x;
else if (x<=r) y = -Math.Sqrt(4-x*x)+2;
else if (x<=2*r) y = Math.Sqrt(4-(x-2)*(x-2));
else y = -x+2*r;
Console.WriteLine("y = " + y);
Console.ReadLine();
}
}
Пример:
<span>r = 2
x = 3
y = 1.73205080756888</span>