|
|
вернуться в форумHELP ME PLEASE! I have 1 test runs but on the server WA test 1!!??? program pro; var n,k,t:byte; s:string; sum:integer; BEGIN read(n,s); t:=1; k:=length(s)-1; if n mod k=0 then begin sum:=n; while n-t*k>0 do begin sum:=sum*(n-t*k); t:=t+1; if sum*(n-t*k)<0 then break; end; sum:=sum*k; end else begin sum:=n; while n-t*k>0 do begin sum:=sum*(n-t*k); t:=t+1; if sum*(n-t*k)<0 then break; end; sum:=sum*(n mod k); end; write(sum); END. 9 !! My program write 945 and why WA 1?????? |
|
|