zoukankan      html  css  js  c++  java
  • HDU_2052——画矩形

    Problem Description
    Give you the width and height of the rectangle,darw it.
     
    Input
    Input contains a number of test cases.For each case ,there are two numbers n and m (0 < n,m < 75)indicate the width and height of the rectangle.Iuput ends of EOF.
     
    Output
    For each case,you should draw a rectangle with the width and height giving in the input. after each case, you should a blank line.
     
    Sample Input
    3 2
     
    Sample Output
    +---+ | | | | +---+
     1 #include <cstdio>
     2 int main()
     3 {
     4     int n,m;
     5     while(~scanf("%d%d",&n,&m))
     6         {
     7             printf("+");
     8             for(int i=0;i<n;i++)
     9                 {
    10                     printf("-");    
    11                 }
    12             printf("+
    ");
    13             for(int i=0;i<m;i++)
    14                 {
    15                     printf("|");
    16                     for(int j=0;j<n;j++)
    17                         {
    18                             printf(" ");    
    19                         }
    20                     printf("|
    ");
    21                 }
    22             printf("+");
    23             for(int i=0;i<n;i++)
    24                 {
    25                     printf("-");    
    26                 }
    27             printf("+");
    28             printf("
    
    ");
    29         }
    30     return 0;    
    31 }
    ——现在的努力是为了小时候吹过的牛B!!
  • 相关阅读:
    01 WEB白帽子Python入门
    07 SSRF漏洞
    JAVA基础学习day04--IDEA、方法
    一些常用的计算机快捷指令
    记录一次xss平台的安装
    upload-labs
    蓝队防护基础
    bagecms的代码审计
    window入侵排查基本
    常用端口总结
  • 原文地址:https://www.cnblogs.com/pingge/p/3185121.html
Copyright © 2011-2022 走看看