http://acm.hdu.edu.cn/showproblem.php?pid=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
+---+
|      |     
|      |
+---+
 
代码:

#include <bits/stdc++.h>

using namespace std;

int a[100][100];
int len; int main()
{
int n,m;
while(cin>>m>>n)
{
for(int i=1; i<=n+2; i++)
{
if(i==1||i==n+2)
for(int j=1; j<=m+2; j++)
{
if(j==1)
cout<<"+";
else if(j==m+2)
cout<<"+"<<endl;
else
cout<<"-";
}
else
for(int j=1; j<=m+2; j++)
{
if(j==1)
cout<<"|";
else if(j==m+2)
cout<<"|"<<endl;
else
cout<<" ";
}
}
cout<<endl;
}
return 0;
}

  

HDU 2052 Picture的更多相关文章

  1. hdu 2052 Picture(java)

    问题: 開始直接用输入的数作为宽和高,但实际上要多出两行边框,所以要加一个2. 还有题目要求最后要输出一个空行没有注意到. Picture Time Limit: 1000/1000 MS (Java ...

  2. HDU 1828 Picture(长方形的周长和)

    HDU 1828 Picture 题目链接 题意:给定n个矩形,输出矩形周长并 思路:利用线段树去维护,分别从4个方向扫一次,每次多一段的时候,就查询该段未被覆盖的区间长度,然后周长就加上这个长度,4 ...

  3. HDU 1828 Picture(线段树扫描线求周长)

    Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Su ...

  4. hdu 1828 Picture(线段树 || 普通hash标记)

    http://acm.hdu.edu.cn/showproblem.php?pid=1828 Picture Time Limit: 6000/2000 MS (Java/Others)    Mem ...

  5. HDU 1828 Picture (线段树+扫描线)(周长并)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1828 给你n个矩形,让你求出总的周长. 类似面积并,面积并是扫描一次,周长并是扫描了两次,x轴一次,y ...

  6. 杭电ACM 2052 Picture

    Picture Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Su ...

  7. 51nod 1206 && hdu 1828 Picture (扫描线+离散化+线段树 矩阵周长并)

    1206 Picture  题目来源: IOI 1998 基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题  收藏  关注 给出平面上的N个矩形(矩形的边平行于X轴 ...

  8. hdu 1828 Picture 切割线求周长

    Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Sub ...

  9. HDUJ 2052 Picture 模拟

    Picture Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Su ...

随机推荐

  1. 使用requests模块post payload请求

    import json import requests import datetime postUrl = 'https://sellercentral.amazon.com/fba/profitab ...

  2. Android UI开发神兵利器之Android Action Bar Style Generator

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/x359981514/article/details/26283129 ActionBar是3.0后的 ...

  3. Smith Numbers POJ - 1142 (暴力+分治)

    题意:给定一个N,求一个大于N的最小的Smith Numbers,Smith Numbers是一个合数,且分解质因数之后上质因子每一位上的数字之和 等于 其本身每一位数字之和(别的博客偷的题意) 思路 ...

  4. ucml选项卡

    当业务视图组件VC并排摆放时就会形成选项卡,本章介绍选项卡有关的操作函数和事件. 页面中有三个对象:TabStrip,Panel和Tab,TabStrip含Panel对象和Tab对象.业务单元BPO没 ...

  5. metamask源码学习-controller-transaction

    ()metamask-extension/app/scripts/controllers/transactions Transaction Controller is an aggregate of ...

  6. centos6安装tomcat8.5

    //参考https://www.cnblogs.com/xdp-gacl/p/4097608.html [root@192 ~]# mount /dev/sr0 /mnt/usb1[root@192 ...

  7. Android学习之多触点滑动

    知识点: 1.对矩阵:Matrix类熟悉,链接:https://blog.csdn.net/jdsjlzx/article/details/52741445 2.MotionEvent详解:https ...

  8. SkylineGlobe的PopupMessage里面嵌入的网页如何与主页面交互通讯

    1.主页面调用PopupMessage,如果需要传值,就是普通的页面间的传值就可以实现了. a.html页面调用PopupMessage创建方法,url传入b.html?x=111&y=22; ...

  9. highcharts中数据列点击事件

    Highcharts.chart('container', { xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul ...

  10. virtualbox - 2台虚拟机之间通过ssh互访

    virtualbox 5.2.12 一台虚拟机是Debian 9,另一台是Ubuntu 18.04. 注意: 2台虚拟机系统里要安装ssh ! sudo apt install ssh 然后在virt ...