最大公约数 while语句hvar a,b,c:longint;beginwrite('a,b=');readln(a,b);while b>0 do beginc:=a mod b;a:=b;b:=c;endwrite(a);end.while b>0 do 中b>0 为什么help!

来源:学生作业帮助网 编辑:作业帮 时间:2024/08/29 12:50:37
最大公约数 while语句hvar a,b,c:longint;beginwrite('a,b=');readln(a,b);while b>0 do beginc:=a mod b;a:=b;b:=c;endwrite(a);end.while b>0 do 中b>0 为什么help!
xՑMO0ǿJ=m$dL)ߥ"$.JL|;l.Q3xsdq/1i| Cb3=k,bx'OI|LrQ}/bcyCۑQpP2R0 #f=@k鄢:aN`7;RֵYbz:~gH* y0j9H@ f}Jw'fCZhc!}gc>I5_b:Sy1{_ɲcqfŕ5tRlE唡40W$'Z

最大公约数 while语句hvar a,b,c:longint;beginwrite('a,b=');readln(a,b);while b>0 do beginc:=a mod b;a:=b;b:=c;endwrite(a);end.while b>0 do 中b>0 为什么help!
最大公约数 while语句
hvar a,b,c:longint;
begin
write('a,b=');
readln(a,b);
while b>0 do begin
c:=a mod b;
a:=b;
b:=c;
end
write(a);
end.
while b>0 do 中b>0 为什么
help!

最大公约数 while语句hvar a,b,c:longint;beginwrite('a,b=');readln(a,b);while b>0 do beginc:=a mod b;a:=b;b:=c;endwrite(a);end.while b>0 do 中b>0 为什么help!
b==0,不就是除尽了吗,这时就应该退出循环,打印最后那个a了