1 #include <iostream>
2 using namespace std;
3 int main()
4 {
5 int a[1000];
6 int digit,n;
7 cin>>n;
8 a[0]=1;
9 digit=1;
10 for(int i=2;i<=n;i++){
11 int num=0;
12 for(int j=0;j<digit;j++){
13 int tmp = a[j]*i+num;
14 a[j] = tmp%10;
15 num = tmp/10;
16 }
17 while(num){
18 a[digit] = num%10;
19 num = num/10;
20 digit++;
21 }
22 }
23 for(int i = digit-1;i>=0;i--){
24 cout<<a[i];
25 }
26 cout<<endl;
27 return 0;
28 }