练习题3
求1+2!+3!+...+20!的和
public class jiecheng {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a, sum=0,s=1;
for(a=1;a<21;++a){
s*=a;
sum+=s;
}
System.out.print(sum);
}
}