A=a - это глупость.
if not(a>b) then a:=b; <-так правильнее.
Program Task;
Uses GraphABC;
Const b = 4; r = 20 ;
d: Array [1..4, 1..2] of Integer = ((1, 0), (0, 1), (-1, 0), (0, -1));
xs: Array [1..b] of Integer = (r + r Div 2, WindowWidth - (r + r Div 2), WindowWidth - (r + r Div 2), r + r Div 2);
ys: Array [1..b] of Integer = (r + r Div 2, r + r Div 2, WindowHeight - (r + r Div 2), WindowHeight - (r + r Div 2));
Var x, y, dir: Array [1..b] of Integer;
i, j: Integer;
Begin
LockDrawing;
For i := 1 To b Do
Begin
x[i] := xs[i];
y[i] := ys[i];
dir[i] := i;
End;
While True Do
Begin
Window.Clear;
For i := 1 To b Do
Circle(x[i], y[i], r);
For i := 1 To b Do
Begin
x[i] := x[i] + d[dir[i], 1];
y[i] := y[i] + d[dir[i], 2];
End;
For i := 1 To b Do
For j := 1 To b Do
If (x[i] = xs[j]) And (y[i] = ys[j]) Then
If dir[i] < b Then
dir[i] := dir[i] + 1
Else
dir[i] := 1;
Redraw;
End;
<span>End.</span>
var a: real;
begin
readln(a);
writeln((2 * a * a * a + 8)/(3 * a));
end.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
double Ax, Bx, Cx;
Scanner sc = new Scanner(System.in);
try {
System.out.println("Waiting for input A, B and C...");
Ax = sc.nextDouble();
Bx = sc.nextDouble();
Cx = sc.nextDouble();
if (!(Cx > Math.min(Ax, Bx) && Cx < Math.max(Ax, Bx))) {
System.out.println("Неверные входные данные.");
return;
}
double AC = Math.abs(Cx - Ax);
double BC = Math.abs(Cx - Bx);
System.out.println("AC = " + AC);
System.out.println("BC = " + BC);
System.out.println("AC * BC = " + AC * BC);
} catch (RuntimeException e) {
System.out.println("Неверные входные данные.");
}
}
}
Проблемы, вопросы или предложения по работе программы? Прошу в комментарии.