求助70tps
查看原帖
求助70tps
1121276
fuxueziyi楼主2025/1/6 09:10
#include <iostream>
using namespace std;
int main() {
	double s,x,v=7,now=0;
	cin>>s>>x;
	while(1){
		now+=v;
		v*=0.98;
		if(now>=s-x and now<=s+x){
			if(now+v>s+x){
				cout<<"n"<<endl;
				return 0;
			}
			else{
				cout<<"y"<<endl;
				return 0;
			}
		}
		else if(now>s+x){
			cout<<"y"<<endl;
			return 0;
		}
	}
}
2025/1/6 09:10
加载中...