zoukankan      html  css  js  c++  java
  • HDU 2052 Picture

    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
    +---+ | | | | +---+
    View Code
     1 #include<stdio.h>
     2 int main() {
     3  int n,m;
     4  while(scanf("%d%d",&n,&m)!=EOF){
     5   printf("+");
     6   for(int i=1;i<=n;++i)
     7   printf("-");
     8   printf("+\n");
     9   for(int i=1;i<=m;++i) {
    10    for(int j=1;j<=n+2;++j)
    11    if(j==1||j==(n+2))
    12    printf("|");
    13    else
    14    printf(" ");
    15    printf("\n");
    16   }
    17   printf("+");
    18   for(int i=1;i<=n;++i)
    19   printf("-");
    20   printf("+\n\n");
    21  }
    22  return 0;
    23 }
     
  • 相关阅读:
    一段简单的js让png24兼容ie6,单张图片有效
    “按需加载”的应用
    前端....
    项目小结
    Ember初始化实例
    Emberjs 分页
    Emberjs搜索
    promise链式
    Emberjs路由
    Emberjs笔记
  • 原文地址:https://www.cnblogs.com/xiaxiaosheng/p/3073757.html
Copyright © 2011-2022 走看看