AC代码
2024-09-17 16:29:21
发布于:浙江
2阅读
0回复
0点赞
#include <iostream>
#include <cmath>
double meter = 7 , s , a , l , r , now = 0;
using namespace std;
bool tcstsf(double s , double a){
l=s-a;
r=s+a;
for(;;)
{
if (now>r)
{
cout<<'n';
return 0;
}
if (l<=now&&now<=r)
{
if (now+meter>r)
{
return true;
}
else
{;
return false;
}
}
now+=meter;
meter*=0.98;
}
}
int main(){
cin >> s >> a;
bool isDangerous = tcstsf(s, a);
if (!isDangerous) {
cout << "y";
} else {
cout << "n";
}
return 0;
}
这里空空如也
有帮助,赞一个