输入一个正整Erepeat (o<repeat<10),像repeat次下列运算: 输入一个学生的数学成绩,如果它低于60,输出"Fail", 否则,输出Pass”。输出使用System.out.pintntln("Pass")及System.out.println('Fail").
时间:2019-06-18 23:28:00
收藏:0
阅读:484

代码:
1 import java.util.*;
2 public class Main {
3 public static void main (String [] args) {
4 int repeat,score;
5 Scanner s=new Scanner(System.in);
6 repeat=s.nextInt();
7 for(int i=1;i<=repeat;i++) {
8 score=s.nextInt();
9 if(score<60) {
10 System.out.println("Fail");
11 }
12 else {
13 System.out.println("Pass");
14 }
15 }
16 }
17 }
原文:https://www.cnblogs.com/fandehui/p/11048303.html
评论(0)