hongqihuaxia666 @ 2024-02-03 16:10:31
注意,不是题解,这是错码
#include <bits/stdc++.h>
#define int long long
#define C cin>>
#define CO cout<<
#define M max
#define MI min
using namespace std;
signed main()
{
float ans=0;
int n;
C n;
for(int i=1;i<=n;i++)
{
int h;
C h;
ans+=h;
}
ans/=n;
printf("%.2lf",ans);
return 0;
}
float和double有区别,慎用! (我就栽在这儿)
by Royihavnotbrain @ 2024-07-01 23:12:55
好神奇,为什么会有区别呢?
by Shihaowen666 @ 2024-07-10 14:52:49
@Royihavnotbrain float是单精度类的,“%lf”是以小数形式输出双精度
by Shihaowen666 @ 2024-07-10 14:53:59
@hongqihuaxia666 想知道你为什么写那么长