package day141018;
/**
* 谁是小偷
*
* @author XWJ
*
*/
public class Thief {
<span style="white-space:pre"> </span>public static void main(String[] args) {
<span style="white-space:pre"> </span>for (int a = 0; a <= 1; a++) {
<span style="white-space:pre"> </span>for (int b = 0; b <= 1; b++) {
<span style="white-space:pre"> </span>for (int c = 0; c <= 1; c++) {
<span style="white-space:pre"> </span>for (int d = 0; d <= 1; d++) {
<span style="white-space:pre"> </span>if (a + b + c + d == 1 && b + d == 1 && b + c == 1) {
<span style="white-space:pre"> </span>int A = a;
<span style="white-space:pre"> </span>int B = b;
<span style="white-space:pre"> </span>int C = c;
<span style="white-space:pre"> </span>if (A == 1) {
<span style="white-space:pre"> </span>System.out.println("小偷是a");
<span style="white-space:pre"> </span>} else if (B == 1) {
<span style="white-space:pre"> </span>System.out.println("小偷是b");
<span style="white-space:pre"> </span>} else if (C == 1) {
<span style="white-space:pre"> </span>System.out.println("小偷是c");
<span style="white-space:pre"> </span>} else {
<span style="white-space:pre"> </span>System.out.println("小偷是d");
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
<span style="white-space:pre"> </span>}
}
谁是小偷
最新推荐文章于 2022-12-23 08:50:39 发布