ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1083. Factorials!!!

9 !! - ввод
945 - вывод
пишет wrong answer

var n,i:integer;
    res:longint;
    k:string;
begin
read(n,k);
i:=0;
res:=1;
 if n mod length(k)=0 then
 repeat
  res:=res*(n-i);
  inc(i,length(k));
 until n-i=length(k)
 else
  repeat
   res:=res*(n-i);
   inc(i,length(k));
  until n-i=1;
writeln(res);
end.
как решил
mne toje takoy:
---------------------
var
x,s:string; s1,j,i,c,l:longint;
begin
read(x);
repeat
i:=i+1;
s:=s+x[i];
until x[i]=' ';
l:=length(x)-i;
val(s,s1,c);
j:=s1;
repeat
j:=j-l;
s1:=s1*j;
until j<=1;
write(s1);
end.