if判断语句以及键盘输入
public class KbIn {
public static void main(String[] agrs) {
java.util.Scanner s=new java.util.Scanner(System.in);//java的键盘输入,只需要写一个就行;
System.out.print("请输入学生的分数: ");
int score=s.nextInt(); //键盘扫入分数;
//int age=s.nextInt(); //扫入年龄;
//String weather=s.toString(); //扫入文字;
String str="优秀";
if(score>100 ||score<0) {str="分数有误请重新输入";
}else if(score>=90&&score<=100) {str="优秀";
}else if(score>=80&&score<90) {str="良好";
}else if (score>=60&&score<80) {str="及格";
}else if (score>=0&&score <60) {str="不合格";}
System.out.println(str);}
}