第三周作业
public class dic { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入一个年份"); int m=input.nextInt(); if (m%4==0 && m%100!=0 ||m%400==0) { System.out.println(m+"这个年份是闰年"); } else { System.out.println(m+"这个年份不是闰年"); } } }
package set; import java.util.Scanner; public class delop { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println("请输入一个四位数"); int n= input.nextInt(); int b=n%1000/100; if(n>999||n<10000) { if(b%3==0) { System.out.println("是会员"); } else { System.out.println("不是会员"); }}}}
package set; import java.util.Scanner; public class dese { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); int x=input.nextInt(); if(x>0) { System.out.println(x+3); } else if(x==0) { System.out.println(0);} else if (x<0) { System.out.println(x*x-1); } } }
package set; import java.util.Scanner; public class dese { public static void main(String[] args) { Scanner input=new Scanner(System.in); int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); if (a+b>c && a+c>b && b+c>a ) { System.out.println("能组成三角形"); } else { System.out.println("不能形成三角形"); } } }