zoukankan      html  css  js  c++  java
  • 做一个正气的杭电人--hdu2500

    做一个正气的杭电人

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


    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
     
     
     1 #include<cstdio>
     2 #include<cstring>
     3 #include<algorithm>
     4 using namespace std;
     5 char map[55][55];
     6 int main()
     7 {
     8     int a,n,i,j;
     9     scanf("%d",&n);
    10     while(n--)
    11     {
    12         scanf("%d",&a);
    13         for(i=0;i<a*3;i++)
    14         {
    15             for(j=0;j<a;j++)
    16             printf("HDU");
    17             printf("
    ");
    18         }
    19     }
    20     return 0;
    21 }
  • 相关阅读:
    day4递归原理及实现
    day4装饰器
    day4迭代器&生成器&正则表达式
    open()函数文件操作
    Python中的内置函数
    function(函数)中的动态参数
    copy深浅拷贝
    collections模块
    set集合
    字典dict常用方法
  • 原文地址:https://www.cnblogs.com/Eric-keke/p/4719943.html
Copyright © 2011-2022 走看看