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