ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1053. Pinocchio

SOS!
Posted by Amy 18 Jul 2003 15:24
This is my programme,please tell me why I got WA.Thank you!

var n,m,m0,ys:longint;
procedure pd(a,b:longint);
  var t:longint;
  begin
  if a<b then begin
                  t:=b;
                  b:=a;
                  a:=t;
                end;
    while a mod b<>0 do
    begin
      a:=a mod b;
      t:=a;a:=b;b:=t;
    end;
    ys:=b;
  end;
procedure run;
  var i:integer;
  begin
    for i:=1 to n-1 do
    begin
      read(m);
      pd(m0,m);
      m0:=ys;
    end;
    writeln(ys);
  end;
begin
  readln(n);
  read(m0);
  run;
end.