var x, y, z: integer;
r, a, b: integer;
begin
readln(x, у);
if у > x then begin
z:= x; x:= у; у:= z;
end;
a:= x; b:= y;
while b > 0 do begin
r:= a mod b;
a:= b;
b:= r;
end;
writeln(a);
writeln(x);
write(у);
end.
|
#include <iostream>
using namespace std;
main()
{
int x, y, z, r, a, b;
cin >> x >> y;
if (y > x) {
z = x; x = y; y = z;
}
a = x; b = y;
while (b > 0) {
r = a % b;
a = b;
b = r;
}
cout << a << endl;
cout << x << endl;
cout << y;
}
|
x, y = map(int, input().split())
if y > x:
z = x
x = y
y = z
a = x
b = y
while b > 0:
r = a % b
a = b
b = r
print(a)
print(x)
print(y)
|