|
|
back to boardwhi my program is wrong?can enibody halp meeeeeeeeeee????? var g,h,i,j,l,m,n:integer; k:longint; sg,si:byte; s:string; procedure readdata; begin readln (n,s); end; procedure solve; begin sg:=length(s)-1; k:=n; g:=1; for j:=1 to n div 2 do begin if sg mod n <> 0 then begin if j=n div 2 then k:=k*(n mod sg) else if n>j*sg then k:=k*(n-j*sg) else if k=0 then begin k:=0; exit; end; end else begin if j=n div 2 then k:=k*sg else if n>j*sg then k:=k*(n-j*sg) else if k=0 then begin k:=0; exit; end; end; end; end; procedure print; begin writeln (k); end; begin readdata; solve; print; end. |
|
|