萌新求助

P1001 A+B Problem

qazwsxplokij @ 2020-01-22 23:15:03

#include <stdio.h>
int main(void)
{
    double a=0,b=0;
    scanf("%lf %lf",&a,&b);
    printf("%lf\n",a+b);
    return 0;
}

这道题为什么用double就是错的呀?


by StarLbright40 @ 2020-01-22 23:15:40

double默认输出六位小数


by qazwsxplokij @ 2020-01-22 23:22:22

@星光0000 谢谢大佬


by love2019 @ 2020-01-23 17:04:00

应该是long long


by caoxuran @ 2020-02-14 12:40:56

不用long long ,用int 也行


by zhazha_855384 @ 2020-02-15 11:29:33

而且double会输出科学计数法


|