1.public class jiecheng{
public static void main(String[] args) {
for(int i=1;i<=5;i++){
int mul=1;
System.out.println(i+"!="+mul);
}
运行结果5!=120
2.
public class jiecheng{
public static void main(String[] args){
int i=1;
int mul=1;
while(i<=10){
mul*=i;
System.out.println(i+"的阶乘为"+mul);
i++;
}
}
}
3.public class jiecheng{
public static void main(String[] args)
{ int i=1; int sum=1;
do{ sum=sum*(i+1); i++;
}
while(i<10);
原文:https://www.cnblogs.com/yanqianying1/p/10591453.html