为什么wa了一个??求帮助
查看原帖
为什么wa了一个??求帮助
874803
wangmang楼主2022/11/17 09:40
#include<bits/stdc++.h>
using namespace std;
int main(){
    int s,x,i;
    bool t=0;
    double n=0,m=7;
    cin>>s>>x;
    i=s;
    s=i-x;
    x=i+x;
    i=1;
    for(;;)
    {
    	n=n+m;
    	if(n>=s)
    	{
    		if(t==1)
    		{
    			if(n>x)
    			{
    				cout<<"n";
				}
				else
				{
					cout<<"y";
				}
				return 0;
			}
			if(n>x)
			{
				cout<<"n";
				return 0;
			}
			else
			{
				t=1;
			}
			
		}
		m=m*0.98;
	}
	return 0; 
}
2022/11/17 09:40
加载中...