|
|
вернуться в форумHahaha~~~So easy (with my ACP) const f:array[1..9] of longint=(1,10,1,670,1,55252,1,4816030,1); var n:byte; begin readln(n); writeln(f[n]); end. Stop posting your AC programs to the board! (-) It's really a bad habit. > Yap, who posts his programs, is a DEVIL My pascal has the right answer! Послано £姜维£ 12 май 2004 05:07 var a,b,c,d,e,f,g,h,n,x:longint; begin readln(n); x:=0; if n=2 then begin for a:=0 to 9 do for b:=0 to 9 do if a=b then x:=x+1;end; if n=4 then begin for a:=0 to 9 do for b:=0 to 9 do for c:=0 to 9 do for d:=0 to 9 do if a+b=c+d then x:=x+1; end; if n=6 then begin for a:=0 to 9 do for b:=0 to 9 do for c:=0 to 9 do for d:=0 to 9 do for e:=0 to 9 do for f:=0 to 9 do if a+b+c=d+e+f then x:=x+1; end; if n=8 then begin for a:=0 to 9 do for b:=0 to 9 do for c:=0 to 9 do for d:=0 to 9 do for e:=0 to 9 do for f:=0 to 9 do for g:=0 to 9 do for h:=0 to 9 do if a+b+c+d=e+f+g+h then x:=x+1; end; writeln(x); readln end. Is it fast enough? It is slow in my computer (Maybe my computer is too old..) Edited by author 20.05.2004 13:28 Re: Hahaha~~~So easy (with my ACP) what do you want from him? his program works :-) thanks HAndsomeG :-) |
|
|