哪位好心人帮忙看一下 只通过了1,2检测点

P1009 [NOIP1998 普及组] 阶乘之和

telankesi @ 2022-11-06 11:35:10

#include <stdio.h>

int main() { 
    int n;
 long int S=0;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        int t=1;
        for (int j = 1; j <= i; j++) {
            t *= j;
        }
        S += t;
    }
    printf("%lld", S);
    return 0;
}

by WA_sir @ 2022-11-06 11:44:57

@kakaluo_te 这道题要用高精度算法


by telankesi @ 2022-11-06 12:37:02

@WA_sir 为什么啊,我这样写不对吗


by a2lyaXNhbWUgbWFyaXNh @ 2022-11-06 12:47:26

@kakaluo_te 不对。bdfs高精度


by telankesi @ 2022-11-06 12:51:24

@S__B bdfs是什么


by a2lyaXNhbWUgbWFyaXNh @ 2022-11-06 12:55:24

@kakaluo_te 百度。


|