Poj1102 LC-Display

Source: Internet
Author: User

Haha...

A teammate recommended this question to me. I didn't want to do question a because I was too big to read the English question. However, you only need to check the input and output to understand the general idea of this question. It's so nice! I don't like the growth of a fucking question page.

In fact, this question is a simple question of input and output.

CodeAs follows:

# Include <iostream> using namespace STD; /* ---- // B [0] | // C [0] [2] | ----/B [1] | // C [1] [2] | ---- // B [2], for example, it is the basic framework of a number. It can be divided into two types, namely, the '-' part (ROW) and '|' part (multiple rows ). The following array B is used to describe whether or not the '-' part is available, and the array C is used to describe whether the '|' part is available. */Int B [3] [10] = {1, 0, 1, 1, 0, 1, 1, 1, 1}, {0, 0, 1, 1, 1, 1, 1, 0, 1, 1}, {1, 0, 1, 1, 0, 1, 1, 0, 1 }}; int C [2] [10] [2] = {1, 1}, {0, 1}, {0, 1}, {0, 1 }, {1, 1}, {1, 0}, {1, 0}, {0, 1}, {1, 1}, {1, 1 }}, {1, 1}, {0, 1}, {1, 0}, {0, 1}, {0, 1}, {0, 1}, {1, 1 },{ 0, 1 },{ 1, 1 },{ 0, 1 }}; int S, N; int digit [20]; void F (int A [], int N) {int I, j, k; for (I = 1; I <= N; I ++) {cout <''; For (j = 0; j <s; j ++) If (A [digit [I] = 1) cout <'-'; elsecout <''; cout <''; if (I! = N) cout <'';} cout <Endl;} void g (int A [] [2], int N) {int I, J, K; for (I = 1; I <= N; I ++) {if (a [digit [I] [0] = 1) cout <'| '; else cout <''; For (j = 0; j <s; j ++) cout <''; if (A [digit [I] [1] = 1) cout <'|'; else cout <''; if (I! = N) cout <'';} cout <Endl;} int main () {int dec [] = {1, 10,100,100 0, 10000,100 000, 1000000,100 00000, 100000000}; while (CIN> S> N & S * s + N * n! = 0) {int I, j, k; int COUNT = 0; for (I = 1; I <= 8 & COUNT = 0; I ++) if (n <dec [I]) Count = I; for (I = 1; I <= count; I ++) {digit [I] = N/DEC [count-I]; n = n % dec [count-I];} f (B [0], count ); for (I = 0; I <s; I ++) g (C [0], count); F (B [1], count); for (I = 0; I <s; I ++) g (C [1], count); F (B [2], count); cout <Endl ;}return 0 ;}

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.