首页 > 试题广场 >

牛妹数

[编程题]牛妹数
  • 热度指数:13062 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 256M,其他语言512M
  • 算法知识视频讲解
\hspace{15pt}如果一个整数是偶数且大于 50,我们称其为牛妹数。给定一个整数 n,判断其是否为牛妹数。

输入描述:
\hspace{15pt}在一行中输入一个整数 n \left(1 \leqq n \leqq 100\right)


输出描述:
\hspace{15pt}n 是牛妹数,输出\texttt{yes};否则输出\texttt{no}
示例1

输入

50

输出

no

说明

50 为偶数但不大于 50,因此不是牛妹数,输出 no。
示例2

输入

52

输出

yes

说明

52 为偶数且大于 50,因此是牛妹数,输出 yes。

备注:
本题已于下方时间节点更新,请注意题解时效性:
1. 2025-06-03 优化题面文本与格式。
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);

    printf("%s", (n-51)%2>0 ? "yes" : "no");
    return 0;
}

发表于 2025-09-09 20:20:00 回复(0)
n=int(input())
p=1<=n<=100
p1=(n%2==0)*(n>50)
if p:
    print('yes'if p1 else'no')
else:
    print('请满足1≦n≦100的正整数')

发表于 2025-10-27 17:21:28 回复(0)
n = int(input())

if 1 <= n <= 100:
    if n > 50 and n % 2 == 0:  
        print("yes")
    else:            
        print("no")
else:
    print("输入不符合标准,请重新输入")
发表于 2025-07-24 16:12:50 回复(0)
n=int(input())
if n<=50:
    print('no')
else:
    if n%2==0:
        print('yes')
    else:
        print('no')
发表于 2025-12-22 23:47:43 回复(0)
n = int(input())

if n%2==0 and n>50 :
    print('yes')
else:
    print('no')
发表于 2025-12-17 18:33:50 回复(0)
n = int(input())
if (n%2==0)&(n>50):
    print("yes")
else:
    print("no")
发表于 2025-12-08 11:53:52 回复(0)
#include <iostream>
using namespace std;

int main()
{
  int n;cin>>n;
  cout<<(n%2==0&&n>50?"yes":"no");
}

发表于 2025-11-24 00:45:17 回复(0)
n = int(input())
print("yes" if n%2==0 and n>50 else "no")

发表于 2025-11-09 22:52:01 回复(0)
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        //使用Scanner录入一个整数n
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        //判断是否为牛妹数
        //牛妹数:大于50的偶数
        if(n>50&&n%2==0){
            System.out.println("yes");
        }else{
            System.out.println("no");
        }
    }
}
发表于 2025-10-31 16:09:30 回复(0)
a=int(input())
def panduan(sj):
    if sj > 50 and sj%2==0:
        print("yes")
    else:
        print("no")
if 1<=a<=100:
    panduan(a)
else:
    print("不符要求")
发表于 2025-10-16 00:56:45 回复(0)
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            String b = "no";
            if ((1<=a)&&(a<=100)){
                if ((a%2==0)&&(a>50)){
                  b = "yes";
                }
            }
               System.out.println(b);
        }
    }
}

发表于 2025-10-15 12:29:38 回复(0)
//依旧三目运算
#include <stdio.h>

int main() {
    int n;
    scanf("%d",&n);
    n>=1&&n<=100?printf(""):printf("题目要求n>=1&&n<=100");//依旧三目运算符
    n%2==0&&n>50?printf("yes"):printf("no");
    return 0;
}
发表于 2025-09-28 16:51:25 回复(0)
import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        if(n%2 == 0 && n>50 && 1<=n && n<=100){
            System.out.println("yes");
        } else{
            System.out.println("no");
        }
    }
}

发表于 2025-08-25 17:34:23 回复(0)
#include <iostream>
using namespace std;

int main() {
    int a, b;
    while (cin >> a ) { // 注意 while 处理多个 case
        if(a > 50 && a%2==0){
            cout << "yes" << endl;
        }else {
            cout << "no" << endl;
        }
    }
}
// 64 位输出请用 printf("%lld")
发表于 2025-08-06 19:37:20 回复(0)
对于这样抽象的判断,你又如何应对呢?
#include <stdio.h>

int main() {
    int n = 0;

    scanf("%d", &n);

    printf("%s", (!(n & 1) && (n > 50)) ? "yes" : "no");

    return 0;
}


发表于 2025-08-06 18:19:50 回复(0)
use std::io;

fn main() {
    let mut stdin = String::new();

    io::stdin()
        .read_line(&mut stdin)
        .expect("");

    let input = stdin
        .trim()
        .parse::<i64>()
        .expect("");

    if input % 2 == 0 && input > 50 {
        println!("yes")
    } else {
        println!("no")
    }

}
发表于 2025-07-19 15:24:20 回复(0)
#include <iostream>
using namespace std;

int main() {
    int a;
    cin >> a;
    if(a%2 == 0 && a>50){
        cout<<"yes";
    }
    else {
        cout<<"no";
    }
}

发表于 2025-07-14 11:52:18 回复(0)
n = int(input())

if (n % 2 == 0) & (n > 50):
    print("yes")
else:
    print("no")
发表于 2025-07-13 06:02:04 回复(0)
n = int(input())
if n > 50 and n % 2 == 0:
    print("yes")
else:
    print("no")
发表于 2025-07-10 10:12:12 回复(0)
a=int(input())
if a>=51 and a%2==0:
    print('yes')
else:
    print('no')
发表于 2025-07-04 21:46:59 回复(0)