Reckzlessc @ 2021-09-20 15:27:25
#include<iostream>
#include<cstdio>
using namespace std;
int n,k;
int main()
{
cin>>n>>k;
int i=1;
double sum=0.0,s=0.0,j=0.0;
while(i<=n)
{
if(i%k==0)
{
j++;
sum=sum+i;
}
else s=s+i;
i++;
}
double o,p;
o=sum/j;
p=s/double(100-j);
printf("%.1f %.1f",o,p);
}
by Otomachi_Una_ @ 2021-09-20 15:32:19
p=s/double(100-j); //这里写错了`
by Reckzlessc @ 2021-09-21 09:04:32
@ushg8877 好的 谢谢