package com.xiaowu.demo; //求1+2!+3!+...+20!的和. public class Demo21 { public static void main(String[] args) { sum(20); } public static void sum(int n) { long sum = 0; long fac = 1; for (int i = 1; i <= n; i++) { fac *= i; sum += fac; } System.out.pri…
package com.xiaowu.demo; /** * 有1.2.3.4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? * * * @author WQ * */ public class Demo11 { public static void main(String[] args) { number(); } public static void number() { int count = 0; for (int x = 1; x < 5; x++) { for (int…