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 |
谢谢,帮忙看看哪错了program w; var level:array [1..150] of longint; i,n,len,j,r,k,mi,m,mm:longint; ch:char; begin while not eof do begin m:=0; i:=0; for i:=1 to 6 do begin read(ch); if ch='.' then mi:=i else m:=m*10+ord(ch)-48; end; readln(n); mi:=6-mi; fillchar(level,sizeof(level),0); level[1]:=1; len:=1; for i:=1 to n do begin r:=0; for j:=1 to len do begin k:=m*level[j]+r; level[j]:=k mod 10; r:=k div 10; end; while r>0 do begin len:=len+1; level[len]:=r mod 10; r:=r div 10; end; end; mi:=len-n*mi; if mi<0 then begin write('.'); while mi<0 do begin inc(mi); write('0'); end; end; mm:=1; while (level[mm]=0) do mm:=mm+1; for i:=len downto mm do if (len-i+1=mi)and(i<>mm) then write(level[i],'.') else write(level[i]); writeln; end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator