Паскаль:
var a,b:integer;
begin
a:=32; b:=108;
while not (a=b) do
if a>b then a:=a-b else b:=b-a;
writeln(b);
end.
Результат:
4
BASIC
Dim a as Integer = 32
Dim b as Integer = 108
m1:
IF a = b THEN GOTO m2
IF a > b THEN
a = a - b
ELSE
b = b - a
END IF
GOTO m1
m2:
PRINT "b = "; b
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Паскаль:
var a,b:integer;
begin
a:=32; b:=108;
while not (a=b) do
if a>b then a:=a-b else b:=b-a;
writeln(b);
end.
Результат:
4
BASIC
Dim a as Integer = 32
Dim b as Integer = 108
m1:
IF a = b THEN GOTO m2
IF a > b THEN
a = a - b
ELSE
b = b - a
END IF
GOTO m1
m2:
PRINT "b = "; b