标签:cin stream bre include ++ clu cout ios max
1 #include <iostream> 2 using namespace std; 3 const int MAXN = 3000; 4 int f[MAXN]; 5 6 int main(){ 7 int n; 8 cin >> n; 9 f[0] = 1; 10 int i, j; 11 for(i = 2; i <= n; i++){ 12 int c = 0; 13 for(j = 0; j < MAXN; j++){ 14 int s = f[j] * i + c; 15 c = s / 10; 16 f[j] = s % 10; 17 } 18 } 19 for(j = MAXN - 1; j >= 0; j--){ 20 if(f[j]) break; 21 } 22 for(i = j; i >= 0; i--) 23 cout << f[i]; 24 cout << endl; 25 return 0; 26 }
标签:cin stream bre include ++ clu cout ios max
原文地址:http://www.cnblogs.com/jxust-jiege666/p/7384675.html