Cod sursa(job #1949426)
Utilizator | Data | 1 aprilie 2017 23:57:23 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
Program Euclid;
var A,B,C,i,t: Longint;
f,g: text;
begin
assign(f,'euclid2.in');
assign(g,'euclid2.out');
reset(f);
rewrite(g);
read(f,T);
{if A < B then begin
C:= A;
A:= B;
B:= C;
end;}
for i:=1 to t do begin
while B <> 0 do begin
C:= A mod B;
A:= B;
B:= C;
end;
writeln(g,A);
end;
close(f);
close(g);
end.