标签:style io ar color os sp for on div
50
30414093201713378043612608166064768844377641568960512000000000000
代码如下
#include <iostream> #define N 200000 using namespace std; int number[N]; void creat() { number[0] = 1; for(int i = 1; i < N; i ++) number[i] = 0; } int m(int n) { creat(); int result_size = 1; int carryBit = 0; if(n == 1) return result_size; for(int i = 2; i <= n; i ++) { for(int j = 0; j < result_size; j ++) { int temp = number[j] * i + carryBit; number[j] = temp % 10; carryBit = temp / 10; } while(carryBit != 0) { number[result_size] = carryBit % 10; result_size ++; carryBit = carryBit / 10; } } return result_size; } void print() { int n; cin >> n; int t = m(n); for(int i = t - 1; i >= 0; i --) cout << number[i]; cout << endl; } int main() { print(); return 0; }
标签:style io ar color os sp for on div
原文地址:http://blog.csdn.net/u012970287/article/details/41923631