为什么会RE
查看原帖
为什么会RE
544536
x232楼主2022/11/23 22:15
#include<bits/stdc++.h>
using namespace std;
int n,k;
double S(int k)
{
	double o=0;
	int cnt=0;
	for(int i=1;i<=k;i++)
	{
		cnt+=i;
	}
	o=(k/cnt);
	return o;
}
int main()
{
    cin>>k;
    while(S(n)>k)
    {
    	n++;
	}
	cout<<n;
	return 0;
}
2022/11/23 22:15
加载中...