标签:大数阶乘
#include <iostream> #include <cstring> #include <cstdlib> using namespace std; int main() { int arr[20000]; memset(arr,0,sizeof(arr)); int m; int count = 0; cin >> m; arr[0] = 1; for (int i = 2; i <= m; i++) { for (int j = 0; j < 20000; j++) { count = arr[j] * i + count; arr[j] = count % 10; count = count / 10; } } int i; for (i = 20000 - 1; !arr[i];i--); for (; i >= 0;i--) { cout << arr[i]; } cout << endl; return 0; }
标签:大数阶乘
原文地址:http://blog.csdn.net/mingyong_blog/article/details/40119181