JAVA作业:编写一个程序,求满足1+2!+3!+...+n!

问题描述:

JAVA作业:编写一个程序,求满足1+2!+3!+...+n!
1个回答 分类:综合 2014-10-15

问题解答:

我来补答
楼上的两个答案都不对.都忘了将 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(sum
 
 
展开全文阅读
剩余:2000