ACM___________________________

______________白白の屋
posts - 182, comments - 102, trackbacks - 0, articles - 0

HDOJ 2500 HDU 2500 Stars ACM 2500 IN HDU

Posted on 2010-08-29 22:14 MiYu 阅读(732) 评论(0)  编辑 收藏 引用 所属分类: ACM ( 水题 )

MiYu原创, 转帖请注明 : 转载自 ______________白白の屋    

 

题目地址:

   http://acm.hdu.edu.cn/showproblem.php?pid=2500 

题目描述:

做一个正气的杭电人

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2320    Accepted Submission(s): 1887


Problem Description
做人要有一身正气,杭电学子都应该如此。比如我们今天的考试就应该做到“诚信”为上。
每次考试的第一个题目总是很简单,今天也不例外,本题是要求输出指定大小的"HDU"字符串,特别地,为了体现“正气”二字,我们要求输出的字符串也是正方形的(行数和列数相等)。
 

Input
输入的第一行包含一个正整数N(N<=20),表示一共有N组数据,接着是N行数据,每行包含一个正整数M(M<=50),表示一行内有M个“HDU”相连。
 

Output
输出指定大小的方形字符串,输出格式参见样本数据。
 

Sample Input
2 1 2
 

Sample Output
HDU HDU HDU HDUHDU HDUHDU HDUHDU HDUHDU HDUHDU HDUHDU
 

水水更健康...................

/*
MiYu原创, 转帖请注明 : 转载自 ______________白白の屋
          http://www.cnblog.com/MiYu
Author By : MiYu
Test      : 1
Program   : 2500
*/

#include <iostream>
using namespace std;
int main ()
{
    int T;
    cin >> T;
    while ( T -- )
    {
          int N;  cin >> N;
          for ( int j = 1; j <= 3 * N; ++ j )
          {
                for ( int i = 1; i <= N; ++ i )
                      cout << "HDU";
                cout << endl;
          }
       
    }
    return 0;
}

 

 


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理