I don't hang out. 2 Nyoj (Simple Simulation)

Source: Internet
Author: User

I'm not going to hang. 2 time limit: +Ms | Memory Limit:65535KB Difficulty:0
Describe
To say seniors who kind, ACM find LY. Yes, I can no longer agree with the above sentence. The question comes: Draw 8.
Input
the first behavior of the input is an integer n, which indicates that there are n sets of data behind it.
Each set of data has one character and one integer, the character represents the brush, and the Integer (>=5) represents the height.
Output
The horizontal line is always one character thick, and the vertical bar increases by 1 characters justifies with a total height of 6. When the total height increases from 5 to 6 o'clock, the vertical bar width rises from 1 to 2. The lower lap height is not less than the upper lap height, but should be as close as possible to the upper ring height, and the inner diameter of the lower ring is
Each draw a "8" should be empty line, that is, between the two groups have a gorgeous split line
Sample input
2 a 7B 8
Sample output
  AAAA  aaaa  aa  aaaa  aaaa  AA  aa<---Gorgeous split line--->  bbbbb   BBBB   BB  bbbbb   BBBB   BBBB   BB  BBB
Source

Uploaded by

#include <iostream> #include <stdio.h> #include <algorithm> #include <string.h>using namespace    Std;char c;int N;int Main () {int t;    cin>>t;        for (int i=0;i<t;i++) {cin>>c>>n;        cout<<c<<endl;        int a=n/6+1;        int b= (n-3)/2;        if ((n-3)%2!=0) b++;        cout<<a<< "" <<b<<endl;        int j,k; for (j=1;j<=n;j++) {if (j==1| | j==n| |                        J==n-b-1) {for (k=1;k<=a+b;k++) {if (k<=a)                    cout<< "";                else cout<<c; }} else {for (k=1;k<=2*a+b;k++) {if                    (k>a&&k<=a+b) cout<< "";                else cout<<c;            }            }cout<<endl;    } if (i!=t-1) cout<< "<---gorgeous split line--->" <<endl; }}



I don't hang out. 2 Nyoj (Simple Simulation)

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.