黄梅时节家家雨,青草池塘处处wa 25TPS!!!

P1009 [NOIP1998 普及组] 阶乘之和

xuweiyuan @ 2024-07-08 21:51:03

#include<iostream>
using namespace std;
int main()
{
    double a = 1, sum = 0;
    int n, i;
    cin >> n;
    for (i = 1; i <= n; i++)
    {
        a = a * i;
        sum = sum + a;
    }
    cout << sum;
    return 0;
}

by ylswznzs @ 2024-07-08 21:55:12

@xuweiyuan 高精度


by ylswznzs @ 2024-07-08 21:55:43

关注一下 @ggylz49 呗


by xuweiyuan @ 2024-07-08 21:59:11

ok


by xuweiyuan @ 2024-07-08 21:59:31

已关


|