在一行中输入一个整数
。
若
是牛妹数,输出
;否则输出
。
50
no
为偶数但不大于
,因此不是牛妹数,输出 no。
52
yes
为偶数且大于
,因此是牛妹数,输出 yes。
本题已于下方时间节点更新,请注意题解时效性:
1. 2025-06-03 优化题面文本与格式。
#include <stdio.h>
int main()
{
int n = 0;
scanf("%d",&n);
if(n%2==0&&n>50)
{
printf("yes");
}
else {
printf("no");
}
return 0;
} #include <iostream>
#include <cassert>
int main() {
int n;
std::cin >> n;
assert(n >= 1 && n <= 100);
// if (n%2==0 && n>50){
// std::cout << "yes" << std::endl;
// }else {
// std::cout << "no" << std::endl;
// }
std::cout << (n%2==0 && n>50 ? "yes" : "no") << std::endl;
return 0;
} #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
printf((n%2==0 && n > 50)? "yes":"no");
return 0;
}