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:26
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
      readln(m);
      pd(m0,m);
      m0:=ys;
    end;
    writeln(ys);
  end;
begin
  readln(n);
  read(m0);
  run;
end.
Re: SOS!
Posted by PSV 21 Oct 2006 01:27
Maybe replace readln to read