用循环法求n! java编程
class jiecheng
{
public static void main(String []args)
{
int n=5,i,sum=1;
for(i=n;i>0;i--)
sum=sum*i;
System.out.println(sum);
}
}
class jiecheng
{
public static void main(String []args)
{
int n=5,i,sum=1;
for(i=n;i>0;i--)
sum=sum*i;
System.out.println(sum);
}
}