Реферат: Генерация дидактических материалов по математике
WHILE X <> Y Do
IF X > Y THEN X := X — Y ELSE Y := Y — X;
Nod := X
END;
{НОК}
Function NoK (X, Y : Integer) : Integer;
Begin
NoK := X * Y Div NoD(X, Y)
END;
Var X1, I, X2, A, C, B : Integer;
Ch, Ch1, Zn, Zn1, BCh, BZn, CCh, CZn, J, V, Vsp : Integer;
Begin
Assign(F, 't:\rustex\kw_ur.tex');
ReWrite(F);
UST;
Randomize;
{Корни уравнения (целые)}
Repeat X1 := -10 + Random(21) Until X1 <> 0;
Repeat X2 := -10 + Random(21) Until X2 <> 0;
B := -(X1 + X2);
C := X1 * X2;
WriteLn(F, '\begin{tabular}{ll}');
Write(F, 'а)~$x^2');
If B <> 0
Then Begin
If B > 0
Then If B <> 1 Then Write(F, '+', B) Else Write(F, '+')
Else If B <> -1 Then Write(F, B) Else Write(F, '-');
Write(F, 'x');