被这题卡了只拿70
查看原帖
被这题卡了只拿70
1053122
shy_lihui楼主2024/10/8 14:58

(我不要脸问红)

#include<bits/stdc++.h>
using namespace std;
long double a,b,c; 
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>a>>b>>c;
	for(long long x=0;;x++)
	{
		//cout<<x<<' '<<(a*2+b*3+c*4+x*5)/(a+b+c+x)<<'\n';
		if(int(float((a*2+b*3+c*4+x*5)/(a+b+c+x))+0.5)>=4)
		{
			cout<<x;
			return 0;
		}
	}
	return 0;
}
2024/10/8 14:58
加载中...