import java.util.*;
public class zuoye_4{
public static void main(String args []){
int score;
Scanner sc = new Scanner(System.in);
score = sc.nextInt();
String s = score < 0?"非法":(score<60?"不及格":(score<70?"及格":(score<80?"中":(score<90?"良":(score<=100?"优秀":"非法"))
)));
System.out.println(s);
}
}
...........
/*
给定年,月份,判断该月有多少天
1、判断闰年:a:能被4整除,但不能被100整除; b:能被400整除;
,1、3、5、7、8、10、12 始终31天
4、6、9始终30天
只有2月会变
import java.util.*;
public class Test01{
public static void main(String args[]){
Scanner scan = new Scanner(System.in);
System.out.print("请出入年份:");
int year = scan.nextInt();
System.out.println("请出入月份:");
int math = scan.nextInt();
switch (math)
{
case 2:
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
{
System.out.println("29天");
}
else
{
System.out.println("28天");
}
switch(month){
case 4:
case 6:
case 9:
case 11:
System.out.println("30天");
break;
}
default:
System.out.println("31天");
break;
}
}
}
*/
/*
//给定年,月份,判断该月有多少天
1、判断闰年:a:能被4整除,但不能被100整除; b:能被400整除;
*/
import java.util.*;
public class NianYue{
public static void main(String args[]){
int year,month,days;
Scanner i = new Scanner(System.in);
System.out.print("请出入年份:");
year = i.nextInt();
System.out.println("请出入月份:");
month = i.nextInt();
System.out.println("年份为"+year);
System.out.println("月份为"+month);
switch (month){
case 2:
if ((year%4==0 && year%100!=0) || (year%400==0)){
System.out.println("29天");
}
else{
System.out.println("28天");
}
}
switch(month){
case 4:
case 6:
case 9:
case 11:
System.out.println("30天");
break;
}
default:
System.out.println("31天");
break;
}
}
......