KobeBeanBryant @ 2020-11-12 18:37:57
#include<bits/stdc++.h>
using namespace std;
int j,p,l,o,i,n,k;
double t,y;
int main(){
cin>>n>>k;
for(i=1;i<=n;i++)
{
if(i%k!=0)
{
p+=i;
o++;
}
else
{
j+=i;
l++;
}
}
t=(j/l)*1.0;
y=(p/o)*1.0;
cout<<fixed<<setprecision(1)<<t<<" ";
cout<<fixed<<setprecision(1)<<y;
}
代码是这样,40分,求助,找不到问题
by w23c3c3 @ 2020-11-12 19:02:35
@KobeBeanBryant 把最后两个