提交时间:2024-08-20 22:13:26
运行 ID: 173620
#include<bits/stdc++.h> #define ll long long using namespace std; char a[1000007]; int main() { int n,str = 1; scanf("%d",&n); a[0] = 1; for(int i=2;i<=n;i++) { int carry = 0,up = 0; int j; for(j=0;j<str;j++) { up = carry % 10; carry/=10; carry += ((a[j])*i + up)/10; a[j] = ((a[j])*i + up)%10; } while(carry) a[j++] = carry%10,carry/=10; str = j; } int i = str; printf("%d!=",n); while(i) putchar(a[i-1]+'0'),i--; printf("\n"); return 0; }