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.