思路与三个布尔变量至少两个为true类似
四个:
boolean a = true;
boolean b = false;
boolean c = false;
boolean d = false;
System.out.println(a^b?(c||d):(a||(c&&d)));
三个:
boolean a = true;
boolean b = false;
boolean c = false;
System.out.println(a^b?c:a);
思路与三个布尔变量至少两个为true类似
四个:
boolean a = true;
boolean b = false;
boolean c = false;
boolean d = false;
System.out.println(a^b?(c||d):(a||(c&&d)));
三个:
boolean a = true;
boolean b = false;
boolean c = false;
System.out.println(a^b?c:a);