Exthond @ 2020-07-29 07:23:16
#include<iostream>
#include<cstdio>
using namespace std;
int n,k,ji1,ji2;
double p1,p2;
int main()
{
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++)
{
if(i%k==0)
{
p1+=i;
ji1+=1;
}
else
{
p2+=i;
ji2+=1;
}
}
p1=(double)p1/ji1;
p2=(double)p2/ji2;
printf("%.1llf %.1llf",p1,p2);
return 0;
}
求问。。。为什么会WA??? 我样例过了,第一个数据下载下来也和输出没区别。。。
by Spikeweed @ 2020-07-29 07:41:24
输出的时候不是%.1lf吗
by Spikeweed @ 2020-07-29 07:41:50
不是2个l吧
by BlueSu @ 2020-07-29 08:42:51
楼上正解
by Exthond @ 2020-07-31 08:47:09
@Spikeweed ...谢谢...是我蠢了...