使用long double
#include <iostream>
#include <cstdio>
using namespace std;
long double ans=0.0, xx;
int main(){
while(scanf("%Lf", &xx)!=EOF)
ans = ans + xx * 1000000;
printf("%.5Lf", ans/1000000);
return 0;
}
原文地址:https://www.cnblogs.com/poorpool/p/8168704.html
时间: 2024-10-09 23:01:13