Basic exercise 01 String time limit: 1.0s memory limit: 256.0MB Problem description
For a 01-string length of 5 bits, each bit can be 0 or 1, a total of 32 possible. The first few of them are:
00000
00001
00010
00011
00100
Please output these 32 kinds of 01 strings in order from small to large.
Input format this question is not entered. Output format output 32 rows, in order from small to large in each row a length of 5 01 strings. Sample Output 00000
00001
00010
00011
< The following sections omit >
#include <stdio.h>int main () {printf ("00000\n");p rintf ("00001\n");p rintf ("00010\n");p rintf ("00011\n"); printf ("00100\n");p rintf ("00101\n");p rintf ("00110\n");p rintf ("00111\n");p rintf ("01000\n");p rintf ("01001\n"); printf ("01010\n");p rintf ("01011\n");p rintf ("01100\n");p rintf ("01101\n");p rintf ("01110\n");p rintf ("01111\n"); printf ("10000\n");p rintf ("10001\n");p rintf ("10010\n");p rintf ("10011\n");p rintf ("10100\n");p rintf ("10101\n"); printf ("10110\n");p rintf ("10111\n");p rintf ("11000\n");p rintf ("11001\n");p rintf ("11010\n");p rintf ("11011\n"); printf ("11100\n");p rintf ("11101\n");p rintf ("11110\n");p rintf ("11111\n"); return 0;}
Blue Bridge Cup Basic Practice 01 string "Violence resolution"