|
|
вернуться в форумpascal program!!! program cl; var n,m,i,j:integer; l:array[1..10000]of integer; a:real; begin readln(n,m); for i:=1 to m do begin readln(j); inc(l[j]); end; for i:=1 to n do begin a:=l[i]/m*100; writeln(a:4:2,'%'); end; end. Who faster My program have on test 0.062cek and 457 КБ. Var N,M,i,N0:longint; S:real; A:array[1..10000] of real; Begin Read(N); Readln(M); S:=100/m; fillchar(A,sizeof(A),0); For i:=1 to m do begin Readln(N0); A[N0]:=A[N0]+S; end; For i:=1 to N do Writeln(A[i]:0:2,'%'); End. Re: Who faster I have 0,046 var arr:array[1..10000] of integer; a:real; i,n,m,tm:integer; begin {for i:=1 to 10000 do arr[i]:=0;} read(n,m); for i:=1 to m do begin read(tm); inc(arr[tm]); end; a:=m; for i:=1 to n do writeln(arr[i]/a*100:0:2,'%') end. Re: Who faster Послано famas 11 авг 2005 04:32 daaaaaaa!!!!!!!! It is not possible!!! What ingenious decision!!! sorry for ALL but I BEST!! Re: CAN IT BE FASTER?? =)) |
|
|