// import java.time.Instant; /** * Created by Administrator on 2018/9/26. */ import java.util.*; public class mian { public static void main(String arge[]) { System.out.println("请输入年份"); Scanner in = new Scanner(System.in); int year; year = in.nextInt(); if (year % 4 == 0 && year % 400 == 0) { System.out.println("是闰年"); } if (year % 100 != 0) { System.out.println("是平年"); } else { System.out.println("是闰年"); } System.out.println("请输入月份"); int month; month= in.nextInt(); switch(month){ case 2: System.out.println( month + "月有28"); break; case 1: break; case 3: break; case 5: break; case 7: break; case 8: break; case 10: break; case 12: System.out.println(month + "月有31"); break; default: System.out.println( month + "月有30"); break; } } }
* Created by Administrator on 2018/9/26. */ public class lian { public static void main(String arge[]){ int a=10; double x=2.3; double c=x+a; int u=(int)x+a; boolean t=2>8||9>2;//或运算 boolean v=2>8&&9>2;//与运算 int r=10; ++a; r++; a--; --r; System.out.println(a++); System.out.println(++r); System.out.println(u%x); System.out.println(Math.atan(-x)); } } //import java.time.Instant; /** * Created by Administrator on 2018/9/26. */ import java.util.*; public class mian { public static void main(String arge[]){ int month; System.out.println("请输入"); Scanner in=new Scanner(System.in); int year; year = in.nextInt(); if(year%4==0&&year%400==0){ System.out.println("是闰年"); } if (year%100!=0){ System.out.println("是平年"); } else System.out.println("是闰年"); } }