HgSO4_QwQ @ 2021-02-21 12:20:32
#include<iostream>
using namespace std;
int a,k,cnt,ans1,ans2;
int main()
{
cin>>a>>k;
for(int i=1;i<=a;i++)
{
if(i%k==0)
{
ans2+=i;
cnt++;
}
else
{
ans1+=i;
}
}
printf("%.1lf %.1lf",ans1/(a-cnt),ans2/cnt);
return 0;
}
0分
by 渡鸦2007 @ 2021-02-21 12:46:08
@Felder 试一下#include<cstdio>