“蓝桥杯”练习系统 - 基础练习 - 01字串

思路:

最简单的方法, 五重循环输出每一位.

 1 #include <iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6     ios::sync_with_stdio(false);
 7     cin.tie(0);
 8 
 9     for (int a = 0; a <= 1; a++)
10         for (int b = 0; b <= 1; b++)
11             for (int c = 0; c <= 1; c++)
12                 for (int d = 0; d <= 1; d++)
13                     for (int e = 0; e <= 1; e++)
14                         cout << a << b << c << d << e << endl;
15 
16     return 0;
17 }
posted @ 2020-01-31 21:23  域Anton  阅读(137)  评论(0)    收藏  举报