4.【EZ】

题目描述

输入一位同学的考试成绩,若是90-100分,输出“Excellent”,80-89输出“Very good”,70-79输出“Good”,60~69输出“Pass”,60分以下输出“No Pass”。

输入格式

输入共一行,一个整数x,表示该同学的分数

输出格式

输出共一行,按照题目要求输出

输入输出样例

输入 #1 复制

50

输出 #1 复制

No Pass

说明/提示

1≤x≤100

#include<iostream>
using namespace std;
int  main(){
	int score;
	cin>>score;
	if(score >= 90 && score <= 100){
		cout<<"Excellent";
	} 
	else if(score >= 80)
		cout<<"Very good";
	else if(score >= 70)
		cout<<"Good";
	else if(score >= 60){
		cout<<"Pass";
	}
	else
		cout<<"No Pass";
return 0;	
}

Java题解:

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        if(x >= 90)
            System.out.println("Excellent");
        else if(x >= 80)
            System.out.println("Very good");
        else if(x >= 70)
            System.out.println("Good");
        else if(x >= 60)
            System.out.println("Pass");
        else
            System.out.println("No Pass");

    }
}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值