求助
查看原帖
求助
474307
XPKAAA楼主2021/7/31 19:04
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<stack>
using namespace std;
int s,x;
float sum=7,cnt,temp;
bool cmp=true;
int main()
{
	cin>>s>>x;
	cnt=s-x;
	if(cnt<0)
	{
		cnt=1;
	}
	while(cmp)
	{
		temp+=sum;
		if(temp>cnt)
		{
			cmp=false;
		}
		sum*=0.98;
	}
	cnt=s+x;
	if(temp>=cnt)
	{
		cout<<"y";
		return 0;
	}
	else
	{
		cout<<"n";
		return 0;
	}
}
2021/7/31 19:04
加载中...