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!!
  • 相关阅读:
    线程状态
    线程的两种实现方式
    设计模式
    移动端适配总结(补充一个移动端touch案例)
    echart.js组件编写
    vuex,文件夹整理
    rem初始化
    PC初始化
    移动端初始化
    三角形实现原理
  • 原文地址:https://www.cnblogs.com/pingge/p/3185121.html
Copyright © 2011-2022 走看看