纸张题目需要高精度,有没有大佬帮忙改一改QAQ
查看原帖
纸张题目需要高精度,有没有大佬帮忙改一改QAQ
1008115
cinemaaa楼主2023/8/24 15:29
#include<bits/stdc++.h>
using namespace std;
int main() {
	long long n,f,n1,j,e=0;
	cin>>n;
	for(long long i=1; i<=n; i++) {
		for(n1=1,j=1;j<=i; j++) {
			n1*=j;
		}
		e+=n1;
		n1=1;
	}
	cout<<fixed<<setprecision(0);
	cout<<e;
    return 0;
}
2023/8/24 15:29
加载中...