Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
为什么WA?var a,b,lcm,gcd,t,s,i:int64; function pp(x,y:int64):boolean; var temp:int64; begin while x mod y<>0 do begin temp:=x mod y; x:=y; y:=temp; end; if y=1 then pp:=true else pp:=false; end; begin readln(gcd,lcm); t:=lcm div gcd; i:=trunc(sqrt(t)); while i>=1 do begin if (t mod i=0) and pp(t div i,i) then begin a:=i*gcd; b:=(t div i)*gcd; writeln(a,' ',b); halt; end; dec(i); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator