#include<iostream> using namespace std; int main() { int i,j,sum,mul; sum=0; for(i=1; i<=20; i++) { mul=1; for(j=i; j>=1; j--) { mul=mul*j; } sum=sum+mul; } cout<<sum; }
#include<iostream> using namespace std; int main() { int i,sum,mul=1; sum=0; for(i=1;i<20;i++) { mul=mul*i; sum=sum+mul; } cout<<sum; }