输入一个正整Erepeat (o<repeat<10),像repeat次下列运算: 输入一个学生的数学成绩,如果它低于60,输出"Fail", 否则,输出Pass”。输出使用System.out.pintntln("Pass")及System.out.println('Fail").

 

代码:

 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 }

 

posted @ 2019-06-18 22:35  DehuiFan  阅读(1303)  评论(0编辑  收藏  举报