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 |
太坑了!!F---CK! i可以小于j!! 为以后童鞋提供代码(pascal)16MS~~var i,j,k,x,y,z,tot,rj,rk:longint; begin j:=1;k:=2; while not eof do begin readln(j,k); rj:=j;rk:=k; z:=0; if j>k then begin x:=j;j:=k;k:=x; end; for i:=j to k do begin tot:=1;x:=i; while x<>1 do begin inc(tot); if odd(x)then x:=x*3+1 else x:=x div 2; end; if tot>z then z:=tot; end; writeln(rj,' ',rk,' ',z); end; end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator