#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
long long fact(int n){
if(n == 1){
return 1;
}
return (1LL * n * fact(n-1)) % MOD;
}
int main(){
int n;
cin >> n;
cout << fact(n) << endl;
return 0;
}
讲解
// return (1LL * n * fact(n-1)) % MOD; 中1ll使整个数变成是long long可以存的,nfact(n-1)是让n (n-1)!的,(n-1)!是n-1n-2n-3*......*1的阶乘, 最后返回出1结果;
//点个赞呗 please
//记得每天保持微笑,tomorrow everthing you will be fine。//鲤鱼🐟