0
已解决
杨子逸
新手天翼
新手天翼
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; int main() { int a,b; cin>>a>>b; if(a%2==0) { if(b%2==0) cout<<"Yes"; else cout<<"No"; } else if(a%2!=0) { if(b%2==0) cout<<"No"; else cout<<"Yes"; } return 0; }
//90分
杨子逸在2018-01-18 12:20:38追加了内容
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; int main() { int a,b; cin>>a>>b; if(a%2==0) { if(b%2==0) cout<<"Yes"; else cout<<"No"; } else if(a%2!=0) { if(b%2==0) cout<<"No"; else cout<<"Yes"; } return 0; }
//90
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
int m,n;
cin>>m>>n;
if((m==7||n%2==m%2)?(cout<<"Yes"):(cout<<"No"));
return 0;
}
错的,80
1
0
郑怡翔
初级天翼
初级天翼
前面先定义,输入后判断b是不是==7,如果是,cout<<"Yes";return 0;
核心:
if(a%2==0)
{
if(b==1 || b==3 || b==5)
{
cout<<"No";
}
else if(b==2 || b==4 || b==6)
{
cout<<"Yes";
}
}
然后判断a是不是奇数如果是,b是奇数的话输出"Yes",否则输出"No";
0
0
0
欧阳语聪
资深守护
资深守护
if(b==7){ cout<<"Yes"; } else if(a%2==b%2){ cout<<"Yes"; } else{ cout<<"No"; }
0
-1
-1