import java.util.Scanner;public class MQ5 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个数"); long a = sc.nextLong(); System.out.println(a/3600+":"+(a%3600)/60+":"+(a%…
import java.util.Scanner;public class MQ3 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("请输入一个在1~15之间的数"); Byte m = sc.nextByte(); int n = 1; int a = 1; int c = 1; int l = 1; for ( n = 1 ; n&l…
public class Mq2 { public static void main(String[]args) { int b = 3; while (b < 7) { System.out.println("吼"); b = b + 1; } //输出结果为四个吼 int a = 3; a++;// do { System.out.println("年轻人不讲would"); }while(a==3); //输出结果为年轻人不讲would }}…
java转换成秒数 Date类有一个getTime()可以换回秒数,例如: public class DateToSecond { public static void main(String[] args) { Date date = new Date(System.currentTimeMillis()); System.out.println(date.getTime()); } } 或者直接使用long类型存储毫秒数, long base = System.currentTimeMill…
package test; import java.util.Scanner; //判断输入的数是不是素数 public class Test18 { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println("输入判断的数"); int a = s.nextInt(); for(int i=2 ; i<=a;i++){ //最小的素数是2 if(…