#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int f[40001];
int main(){
int n;
while( scanf( "%d", &n ) != EOF ){
memset( f, 0, sizeof( f ) );
f[1] = 1;
int len = 1;
for( int i = 2; i <= n; i++ ){
int yu = 0;
int j = 1;
for( ; j <= len; j++ ){
int t = f[j] * i + yu;
f[j] = t % 10;
yu = t / 10;
}
while( yu ){
f[j++] = yu % 10;
yu /= 10;
}
len = j - 1;
}
for( int i = len; i >= 1; i-- ){
cout << f[i];
}
cout << endl;
}
return 0;
}
hdu 1042 大数 N!
最新推荐文章于 2021-02-26 14:50:57 发布