总结:<<:乘法 >>:除法 package com.mmm; public class dfd { public static void main(String[] args) { int i=2; int s=i<<3;//这里是2*8(2的3次方) System.out.println(s); int s2=i<<4; System.out.println(s2);//结果应该是32 int j=160; int s3=j>>2;//结果是…
建议21: 用偶判断,不用奇判断 public class Client { public static void main(String[] args) { Scanner in = new Scanner(System.in); while (in.hasNext()) { int i = in.nextInt(); String str = i + "--->" + (i % 2 == 1 ? "奇数" : "偶数"); System…