第2个回答 2010-04-15
package com.baidu;
public class Testjc {
/**
* @author zpf<br>
* <b>create Date:</b>Apr 15, 2010 6:55:09 PM<br>
* <b>last modify Date:</b>Apr 15, 2010 6:55:09 PM<br>
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] jcarray=new int[10];
int result=0;
for(int i=1;i<11;i++){
int jc=1;
for(int j=1;j<=i;j++){
jc*=j;
jcarray[i-1]=jc;
}
}
for(int i=0;i<jcarray.length;i++){
result+=jcarray[i];
System.out.print(jcarray[i]+"\t");
}
System.out.println();
System.out.print(result);
}
}
大概就这样吧