点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 金牌教程 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From sina007
自行车和三轮车
讨论 Discussion
 
1
#include <iostream>
#include <vector>
using namespace std;

int main() {
0:A,1:B,2:C,3:D,4:E,5:F
  for (int a = 0; a <= 1; a++) {
    for (int b = 0; b <= 1; b++) {
      for (int c = 0; c <= 1; c++) {
        for (int d = 0; d <= 1; d++) {
          for (int e = 0; e <= 1; e++) {
            for (int f = 0; f <= 1; f++) {
              if (a + b == 0) continue;
              if (a == 1 && d == 1) continue;
              if (a + e + f != 2) continue;
              if (b != c) continue;
              if (c + d != 1) continue;
              if (d == 0 && e == 1) continue;
              vector<char> res;
              if (a) res.push_back('A');
              if (b) res.push_back('B');
              if (c) res.push_back('C');
              if (d) res.push_back('D');
              if (e) res.push_back('E');
              if (f) res.push_back('F');
              for (int i = 0; i < res.size(); i++) {
                if (i > 0) cout << " ";
                cout << res[i];
              }
              cout << endl;
            }
          }
        }
      }
    }
  }
  return 0;
}
( )

此主题无回复显示
发布讨论主题 回复讨论主题
Flag
  
题号
  P1698
  模拟
通过
  79人
提交
  170次
通过率
  46%
难度
  0
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1363 | Online Users / Processes : 0 / 68 | Processed Time : 59 ms | Server Time : 2025/12/17 11:05:47