2.BASIC-2
01字串(100分)
[思路]使用五层循环枚举。
AC的C++代码如下:
#include <iostream>
using namespace std;
int main()
{
for(int i=0;i<=1;i++)
{
for(int j=0;j<=1;j++)
{
for(int k=0;k<=1;k++)
{
for(int p=0;p<=1;p++)
{
for(int q=0;q<=1;q++)
{
cout << i << j << k << p << q;
cout << endl;
}
}
}
}
}
cout << endl;
return 0;
}