90分求助!
查看原帖
90分求助!
1073157
_xiaolvsi_楼主2024/1/11 20:20
#include<iostream>//str(函数).size() getline(cin,a) 函数.append(添加字符串,下标,个数) or (个数,'字符串') 函数.find查找 of rfind倒查找 替换 函数.replace(下标,个数,函数,下标,个数) 
#include<string>// erase(下标,个数)or()全删删除  插入 函数.insert(下标,到指定的前面,函数, 下标,个数 or 直接添加) 
#include<algorithm>//<algorithm>sort(stu+1,stu+n+1,cmp(从大到小)) struct
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
	long long n,s,t=0;
	cin>>n>>s;
	t=n;
	if (s==0)
	{
		cout<<"NO"<<endl;
		cout<<"YES"<<endl;
	}
	else if (n==0)
	{
		cout<<"NO"<<endl;
		cout<<"NO"<<endl;
	}
	else if (n==0&&s==0)
	{
		cout<<"NO"<<endl;
		cout<<"NO"<<endl;
	}
	else
	{
		if (t<0)
		{
			if (s==1||s%2==1)
			{
				cout<<"YES"<<'\n';
			}
		}

		else
		{
		cout<<"NO"<<'\n'; 
		}
		if (t%2!=0)
		{
			cout<<"YES"<<'\n';
		}
		else
		{
			cout<<"NO"<<'\n'; 
		}	 
	}
	return 0;
}
2024/1/11 20:20
加载中...