JAVA作业:编写一个程序,求满足1+2!+3!+...+n!
问题描述:
JAVA作业:编写一个程序,求满足1+2!+3!+...+n!
答
楼上的两个答案都不对.都忘了将 n -1 .public class TestNFactorial {public static void main(String[] args){int target = 9876;run(target);}private static void run( int target) {int sum = 0 ;int n=0;while(...