样例过了,但听取WA声一片
查看原帖
样例过了,但听取WA声一片
1329075
guoen23楼主2024/7/11 17:14
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,e = 0;
	long long int d,f = 0;
    double g,h = 1.0;
    cin>>a>>b;
    for(int i = 1;i<=a;i++){
        if(i % b == 0){
            c++;
            e+=i;
        }
        else{
            d++;
            f+=i;
        }
    }
    g = e * 1.0 / c;
    h = f * 1.0 / d;
    cout<<fixed<<setprecision(1)<<g<<" ";
    cout<<fixed<<setprecision(1)<<h;
	return 0;
} 

求调[(ToT)/~~~]

2024/7/11 17:14
加载中...