——VB——
Private Sub Command1_Click()
Dim n As Integer
n = InputBox("请输入n值:")
If n < 0 or fix(n) <> n Then Exit Sub
s = 1
For i = 1 To n
s = s * i
Next
Print Cstr(n) + "!="; s
End Sub
——Pascal——
var i,n,s:longint;
begin
readln(n);
s:=1
for i:=1 to n do s:=s*i;
writeln(s);
end.
My blog:http://hi.baidu.com/billspaceMy blog:http://hi.baidu.com/billspace