import java.util.Scanner;
public class test { public static void main(String[] args) {
int sum; for(int i=1;i<=9999999;i++){ sum=0; int b=i;//作为暂存i int a=b%10;//存储每位数 sum=sum+f(a); b=b/10; while(b>=10){ a=b%10; sum=sum+f(a); b=b/10; } //防止1,2被过掉 if(i>10){ sum=sum+f(b); } if(i==sum){ System.out.println("i="+i); } } }public static int f(int n){ int m; if(n<=1){ m=1; }else{ m=n*f(n-1); } return m;}
}