package day01;
import java.util.Scanner;
public class xieyunchuang {
public static void main(String[] args) {
Scanner input=new Scanner(System.in); int n; System.out.println("输入您要的n");// n=input.nextInt(); System.out.println("开始计算"); DoWhile(n); Digui(n); While(n); System.out.println(); xunhuang(n); } private static void DoWhile(int n) { int i=1; int sum=1; do { sum=sum*i; System.out.print(i+"*"); i++; }while(i<n); sum=sum*n; System.out.println(n+"="+sum); } private static void Digui(int n) { int sum; sum=digui(n); System.out.println(sum); } private static void While(int n) { int i=1,sum=1; while(i<n) { sum=sum*i; System.out.print(i+"*"); i++; } sum=sum*n; System.out.print(n+"="+sum); }private static void xunhuang(int n) {
int temp=1; int sum=1; for(int i=1;i<n;i++) { sum=sum*i; System.out.print(i+"*"); } sum=sum*n; System.out.print(n+"="+sum); } private static int digui(int n) { if (n <= 0) { return 0; } if (n == 1) { System.out.print(n+"="); return 1; } System.out.print(n+"*"); return n * digui(n-1); }}