蓝桥杯练习:基础练习 01字串
来源:互联网 发布:软件测试linux常用命令 编辑:程序博客网 时间:2024/05/22 09:43
问题描述
对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。它们的前几个是:
00000
00001
00010
00011
00100
请按从小到大的顺序输出这32种01串。
输入格式
本试题没有输入。
输出格式
输出32行,按从小到大的顺序每行一个长度为5的01串。
样例输出
00000
00001
00010
00011
00001
00010
00011
<以下部分省略>
#include <iostream>#include <cstdio>#include <iomanip>using namespace std;int main(){ int l,m,n,o,i; for(l=0; l<=1; l++) for(m=0; m<=1; m++) for(n=0; n<=1; n++) for(o=0; o<=1; o++) for(i=0; i<=1; i++) cout<<l<<m<<n<<o<<i<<endl; return 0;}
知识点总结:
运用了5个循环,符合从小到大的要求,刚开始没有动脑筋以为是填充。。。
0 0
- 【蓝桥杯练习系统】 基础练习 01字串
- 蓝桥杯练习:基础练习 01字串
- 蓝桥杯:基础练习 01字串
- 蓝桥杯 【基础练习】 01字串
- “蓝桥杯”基础练习:01字串
- 蓝桥杯基础练习--01字串
- 蓝桥杯基础练习:01字串
- 蓝桥杯 基础练习 01字串
- 蓝桥杯--基础练习 01字串
- 蓝桥杯基础练习 01字串
- 蓝桥杯-基础练习-01字串
- 蓝桥杯 基础练习 01字串
- 蓝桥杯--基础练习--01字串
- 蓝桥杯基础练习 01字串
- 蓝桥杯-基础练习 01字串
- 蓝桥杯基础练习 01字串
- 蓝桥杯-基础练习 01字串
- 蓝桥杯基础练习 01字串
- 实验室项目debug汇总
- bootloader启动引导
- 基于HOG特征和Neural network的人脸检测
- Arch Linux 下Android 源码的下载以及编译
- FLVplayback组件
- 蓝桥杯练习:基础练习 01字串
- 黑马程序员----IO流以及文件的操作
- POJ2236--Wireless Network
- Unrecognized Windows Sockets error: 0
- uva 575
- Meclipse 10 设置 new 菜单
- POJ3614--Sunscreen
- tomcat8配置(win8)
- POJ1703--Find them, Catch them