To be a righteous--hdu2500 of Hangzhou Electric People

Source: Internet
Author: User

To be a righteous Hangzhou electric person

Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 9069 Accepted Submission (s): 7254


Problem description life to have a healthy, Hangzhou electric students should be so. For example, our exams today should be "good faith" as the top.
The first topic of each exam is always very simple, today is no exception, the subject is required to output a specified size of the "HDU" string, in particular, in order to reflect the "upright" word, we require the output of the string is also a square (the number of rows and the number of columns equal).

The first line of input inputs contains a positive integer n (n<=20), which represents a total of n sets of data, followed by n rows of data, each containing a positive integer m (m<=50), indicating that a row has M "HDU" connected to each other.

The output output specifies the size of the square string, which is formatted in the sample data.

Sample Input212

Sample Outputhduhduhduhduhduhduhduhduhduhduhduhduhduhduhdu
1#include <cstdio>2#include <cstring>3#include <algorithm>4 using namespacestd;5 Charmap[ -][ -];6 intMain ()7 {8     inta,n,i,j;9scanf"%d",&n);Ten      while(n--) One     { Ascanf"%d",&a); -          for(i=0; i<a*3; i++) -         { the              for(j=0; j<a;j++) -printf"HDU"); -printf"\ n"); -         } +     } -     return 0; +}

To be a righteous--hdu2500 of Hangzhou Electric People

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.