xinggancaixukun @ 2023-07-25 10:23:38
#include <bits/stdc++.h>
using namespace std;
int a[50];
int main(){
int n,sum;
cin>>n;
for(int i=1;i<=n;i++){
a[i]=a[i-1]*i;
}
for(int i=1;i<=n;i++){
sum+=a[i];
}
cout<<sum;
return 0;
}
by LiJoQiao @ 2023-07-25 10:44:37
@xinggancaixukun 注意数据范围,通过全部数据需要高精度计算。
by xinggancaixukun @ 2023-07-25 10:44:38
@FIGHTINGTEDDY %%%
by xinggancaixukun @ 2023-07-25 10:45:10
@LiJoQiao 高精度是什么高级算法?蒟蒻瑟瑟发抖~
by Ted_LightningTechG_ @ 2023-07-25 10:45:29
@xinggancaixukun 别膜我,我只是帮帮你罢了
by Ted_LightningTechG_ @ 2023-07-25 10:46:03
@xinggancaixukun 网上找博客
by xinggancaixukun @ 2023-07-25 10:46:39
@FIGHTINGTEDDY 哦,看来蒟蒻还需要更加努力
by Ted_LightningTechG_ @ 2023-07-25 10:46:56
@xinggancaixukun https://blog.csdn.net/PYcharmRoot/article/details/122682074?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522169025319416800213010197%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=169025319416800213010197&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~top_positive~default-1-122682074-null-null.268^v1^control&utm_term=%E9%AB%98%E7%B2%BE%E5%BA%A6&spm=1018.2226.3001.4450
by xinggancaixukun @ 2023-07-25 10:47:13
@FIGHTINGTEDDY Orz %%%%%%%
by LiJoQiao @ 2023-07-25 10:47:21
@xinggancaixukun 由于 C++ 自带的变量能存储的范围有限,在表示一些位数很大等高精度数字的时候不能使用,因此可以采用数组模拟一个很大的数来进行相关的计算,这属于高精度的范围。
by Ted_LightningTechG_ @ 2023-07-25 10:48:12
@xinggancaixukun 哎,没事别膜拜,膜拜≠谢谢