package com.zixue.cayman_Findjob01;
import java.util.Scanner;
class zixue01{
public static void main(String[] args){
int year;
System.out.println("please input year");
Scanner input=new Scanner(System.in);
year=input.nextInt();
if(year<0){
System.out.println("data error");
System.exit(0);
}
if(year%4==0&&year%100!=0||year%400==0){
System.out.println("Yes");
}
else{
System.out.println("No");
}
}
}
---------------------------------------------------------------------------------------------------------------------------------
class zixue01{
public static void main(String[] args){
double grade;
char dengji;
System.out.println("please input grade");
Scanner input=new Scanner(System.in);
grade=input.nextDouble();
if(grade<0||grade>100){
System.out.println("error");
}
//System.out.println((int)grade%10);
switch((int)grade/10){
case 9:
System.out.println("A");
break;
case 8:
System.out.println("B");
break;
case 7:
System.out.println("C");
break;
case 6:
System.out.println("D");
break;
default:
System.out.println("E");
}
}
}
注:Switch(a) 此处a必须是整数,case: 每一个后面没有break的话就是连续执行;