Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7219 - Факториалуудын нийлбэр

1!+2!+3!+...+n! нийлбэрийг ол.

Input

Натурал тоо n өгөгдөнө.

Output

Факториалуудын нийлбэр.

Example

Input:
5

Output:
153

Нэмсэн:Bataa
Огноо:2013-01-21
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2019-03-13 01:23:17
#include<iostream>

using namespace std;

int main(){
int a,b,i,d,e=0;
cin >> a;
for (int i=1; i<=a; i++){
b=1;
for(d=1; d<=i; d++)
b = b * d;
e = e + b;
}
cout << e;
return 0;

}
2018-12-24 07:38:38
#include<cstdio>
#include<cstdlib>
#include<cmath>
using namespace std;
main()
{
int a,b,i,j,c=0;
scanf("%d",&a);
for(i=1;i<=a;i++)
{
b=1;
for(j=1;j<=i;j++)
b=b*j;
c=c+b;
}
printf("%d ",c);
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.