Blue Bridge Cup Basic Practice 01 string "Violence resolution"

Source: Internet
Author: User

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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.