tju1016
曹天齐吧
全部回复
仅看楼主
level 6
soso9spikear 楼主
program p1016;const max=10; bo=2;var apple:array[1..max] of integer; q,t,i,b:longint; str:string; win,j,boy:longint; procedure init(cat:longint); begin {readln(str);} {for ii:=length(str) downto 1 do apple[ii+bo]:=ord(str[ii])-ord('0');} //readln(boy); str:=''; for j:=1 to max do str:=str+'1'; boy:=cat; end; procedure time; begin for j:=1 to max do apple[j]:=apple[j]*boy; end; procedure jinwei; begin for j:=2 to max do begin win:=apple[j]; apple[j]:=win mod 10; apple[j-1]:=apple[j-1]+(win div 10); end; end; {procedure print; begin win:=1;while apple[win]=0 do inc(win); while win<=max do begin write(apple[win]);inc(win);end; writeln; end;} procedure main; begin init(i); time; jinwei; //print; end;begin readln(q); for t:=1 to q do begin fillchar(apple,sizeof(apple),0); apple[max]:=1; readln(b); for i:=2 to b do main; i:=1;while apple[i]=0 do inc(i); writeln(apple[i+1]); end;end.
2006年07月07日 13点07分 1
level 6
soso9spikear 楼主
program p1016; const max=32768; bo=11; var apple:array[1..max] of integer; q,t,i,b:longint; str:string; win,j,boy:longint; procedure init(cat:longint); begin {readln(str);} {for ii:=length(str) downto 1 do apple[ii+bo]:=ord(str[ii])-ord('0');} //readln(boy); str:=''; for j:=1 to max do str:=str+'1'; boy:=cat; end; procedure time; begin for j:=1 to max do apple[j]:=apple[j]*boy; end; procedure jinwei; begin for j:=2 to max do begin win:=apple[j]; apple[j]:=win mod 10; apple[j-1]:=apple[j-1]+(win div 10); end; end; {procedure print; begin win:=1;while apple[win]=0 do inc(win); while win<=max do begin write(apple[win]);inc(win);end; writeln; end;} procedure main; begin init(i); time; jinwei; //print; end; begin readln(q); for t:=1 to q do begin fillchar(apple,sizeof(apple),0); apple[max]:=1; readln(b); for i:=2 to b do main; i:=1;while apple[i]=0 do inc(i); writeln(apple[i+1]); end; end.
2006年07月07日 13点07分 2
level 6
soso9spikear 楼主
顺便说一下,由于不能提交,我还不知道对不对
2006年07月20日 12点07分 4
1