if 双向选择结构语法

package com.shaonian.struct;

import java.util.Scanner;

public class IFDemo02 {
public static void main(String[] args) {
//考试分数大于60及格,小于60不及格
Scanner scanner = new Scanner(System.in);
System.out.println("请输入成绩:");
int score = scanner.nextInt();
//score:成绩
if (score>=60){
System.out.println("及格");
}else{
System.out.println("不及格");


}


scanner.close();

}
}

 

posted @ 2022-10-13 19:51  敲码少年  阅读(24)  评论(0编辑  收藏  举报