提交时间:2024-08-20 22:35:17
运行 ID: 173646
#include<bits/stdc++.h> using namespace std; int arr[100005]; int main(){ int n, x; cin >> n; x = n; int len = 1; arr[1] = 1; while(n){ for(int i = 1; i <= len; i++){ arr[i] *= n; } for(int i = 1; i <= len; i++){ if(arr[i] >= 10){ arr[i + 1] += arr[i] / 10; arr[i] %= 10; if(len == i){ len++; } } } n--; } cout << x << "!="; for(int i = len; i >= 1; i--){ cout << arr[i]; } return 0; }