【Factorial】
[code]inputs: Num( numericsimple ) ;variables: double var0( 0 ) ;
if Num >= 0 then
begin
var0 = 1 ;
for Value1 = IntPortion( Num ) downto 2
begin
var0 = var0 * Value1 ;
end ;
Factorial = var0 ;
end
else
Factorial = -1 ;
[/code]
页:
[1]
C + + 版 量 化 | 微信: QQ: |