闰土,这段代码的输出结果为 -nan 不知道为什么。
#include<bits/stdc++.h>
using namespace std;
typedef long double llf;
llf getLlf(){llf t;scanf("%Lf",&t);return t;}
int main()
{
llf smm,def,cha;int t;scanf("%d",&t);
for(int i=0;i<t;++i)smm+=getLlf();
for(int i=0;i<t;++i)def+=getLlf();
cha=smm-def;llf ans=(smm*3-def*2)/cha;
printf("%.6Lf",ans);
}