Program TaskA; Var r1, r2: Integer; Procedure S(r1, r2: Integer); Var s: Real; Begin If r1 > r2 Then s := Pi * (r1 * r1 - r2 * r2) Else s := Pi * (r2 * r2 - r1 * r1); WriteLn('Площадь кольца: ', s:5:2); End; Begin Write('r1 = '); ReadLn(r1); Write('r2 = '); ReadLn(r2); S(r1, r2); ReadLn; End.
Program TaskA; Var r1, r2: Integer; Function S(r1, r2: Integer): Real; Begin If r1 > r2 Then result := Pi * (r1 * r1 - r2 * r2) Else result := Pi * (r2 * r2 - r1 * r1); End; Begin Write('r1 = '); ReadLn(r1); Write('r2 = '); ReadLn(r2); WriteLn('Площадь кольца: ', S(r1, r2):5:2); end.
elav20134518
10.07.2021
DIM Nazv1$, Nazv2$ DIM P1%,O1%,D1%,P2%,O2%,D2%
CLS INPUT "Nazvanie 1: ", Nazv1$ INPUT "Perviy: ", P1 INPUT "Otvetniy: ", O1 INPUT "Nazvanie 2: ", Nazv2$ INPUT "Perviy: ", P2 INPUT "Otvetniy: ", O2 IF P1+O1>P2+O2 THEN PRINT Nazv1$ ELSE IF P1+O1<P2+O2 THEN PRINT Nazv2$ ELSE IF O1-O2>P2-P1 THEN PRINT Nazv1$ ELSE IF O1-O2<P2-P1 THEN PRINT Nazv2$ ELSE PRINT "Dopolnitelnoe:" PRINT Nazv1$ INPUT D1 PRINT Nazv2$ INPUT D2 IF D1>D2 THEN PRINT Nazv1$ ELSE IF D1<D2 THEN PRINT Nazv2$ ELSE PRINT "Nichia" END IF END IF END IF END IF END IF END IF END
Пример:
Nazvanie 1: A Perviy: 2 Otvetniy: 0 Nazvanie 2: B Perviy: 0 Otvetniy: 2 Dopolnitelnoe: A ? 3 B ? 3 Nichia
Var r1, r2: Integer;
Procedure S(r1, r2: Integer);
Var s: Real;
Begin
If r1 > r2 Then
s := Pi * (r1 * r1 - r2 * r2)
Else
s := Pi * (r2 * r2 - r1 * r1);
WriteLn('Площадь кольца: ', s:5:2);
End;
Begin
Write('r1 = ');
ReadLn(r1);
Write('r2 = ');
ReadLn(r2);
S(r1, r2);
ReadLn;
End.
Program TaskA;
Var r1, r2: Integer;
Function S(r1, r2: Integer): Real;
Begin
If r1 > r2 Then
result := Pi * (r1 * r1 - r2 * r2)
Else
result := Pi * (r2 * r2 - r1 * r1);
End;
Begin
Write('r1 = ');
ReadLn(r1);
Write('r2 = ');
ReadLn(r2);
WriteLn('Площадь кольца: ', S(r1, r2):5:2);
end.