题解 | #有容乃大#

及格分数

http://www.nowcoder.com/practice/56513524333148b38945e1989bc7df4e

import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score;
        while(sc.hasNextInt()){
            score = sc.nextInt();
            if(score >= 60) {
                System.out.println("Pass");
            } else {
                System.out.println("Fail");
            }
        }
    }
}

hasNextInt()判断是否还有输入的内容

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务