#include <iostream>//高精度乘法模板题 #include <string> #include <algorithm> #include <cmath> #include <cstring> using namespace std; string ItoS(int x) { string ans=""; while(x!=0) { char c = x%10 +'0'; ans = ans + c; x/=10; } reverse(ans.begin(),ans.end()); return ans; } string Mul(string s1,string s2) { int len1 = s1.size(),len2 = s2.size(); if(len1<len2)swap(s1,s2); int len = len1+len2+1; int n[len+1]; memset(n,0,sizeof(n)); reverse(s1.begin(),s1.end()); reverse(s2.begin(),s2.end()); string ans=""; for(int i=0;i<s1.size();i++) { for(int j=0;j<s2.size();j++) { n[i+j] += (s1[i]-'0')*(s2[j]-'0'); } } for(int i=0;i<len;i++) { int car = n[i]/10; n[i] = n[i]%10; n[i+1] +=car; char c = '0'+n[i]; ans = ans + c; } reverse(ans.begin(),ans.end()); while(ans[0]=='0')ans.erase(0,1); return ans; } int main() { int N; cin>>N; string ans="1"; for(int i=1;i<=N;i++) { ans = Mul(ans,ItoS(i)); } cout<<ans<<endl; }