|
|
back to boardplease help me. here is my program. Posted by Brenda 12 Nov 2002 20:43 program xt; const use :array[0..6] of integer =(3241,1324,1234,2341,1243,1342,2134); var a,p :extended; n,i,pp,t,k,po :integer; j :char; s :string; begin readln(n); for i:=1 to n do begin readln(s); for j:='1' to '4' do begin po:=pos(j,s); delete(s,po,1); end; a:=0; t:=0; for k:=1 to length(s) do if s[k]<>'0' then a:=a*10+(ord(s[k])-48) else inc(t); if a<>0 then write(a:0:0); p:=a-7*int(a/7); pp:=trunc(p); write(use[pp]); for k:=1 to t do write('0'); writeln; end; end. (1)if 0 first, (2)u lose 4 digits which instead of. Re: please help me. here is my program. 'n' must be longint. |
|
|