Picture

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 15932    Accepted Submission(s): 8240

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<iostream>
#include<cstring>
using namespace std; int main()
{
int n,m;
while(cin>>n>>m)
{
char str[85][85];
memset(str,0,sizeof(str));
int i,j;
for(i=0;i<=m+1;i++)
{
for(j=0;j<=n+1;j++)
{
if(i==0 || i==m+1)
str[i][j]='-';
else
str[i][j]=' ';
if(j==0 || j==n+1)
str[i][j]='|';
}
} str[0][0]=str[0][n+1]=str[m+1][0]=str[m+1][n+1]='+';
for(i=0;i<=m+1;i++)
{
for(j=0;j<=n+1;j++)
cout<<str[i][j];
cout<<endl;
}
cout<<endl;
} return 0;
}

HDUJ 2052 Picture 模拟的更多相关文章

  1. hdu 2052 Picture(java)

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

  2. 杭电ACM 2052 Picture

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

  3. HDU 2052 Picture

    http://acm.hdu.edu.cn/showproblem.php?pid=2052 Problem Description Give you the width and height of ...

  4. HDOJ 2052 Picture

    Problem Description Give you the width and height of the rectangle,darw it. Input Input contains a n ...

  5. 杭电oj2047-2049、2051-2053、2056、2058

    2047  阿牛的EOF牛肉串 #include<stdio.h> int main(){ int n,i; _int64 s[]; while(~scanf("%d" ...

  6. mock造数据

    前端开发,需要和后台联调:很多时候,前端开发并不需要等后台完全写好接口在去联调,自己可以写死数据,渲染数据,加样式.后台人员有时会很忙,他没有时间写好返回所有的数据等等,特别是新开一个项目,从零开始的 ...

  7. Gym - 101670E Forest Picture (CTU Open Contest 2017 模拟)

    题目: https://cn.vjudge.net/problem/1451310/origin 题意&思路: 纯粹模拟. 大体题意是这样的: 1.有人要在一个10-9<=x<=1 ...

  8. HDUJ 2074 叠筐 模拟

    叠筐 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submiss ...

  9. QQ模拟自动登录实现

    QQ模拟自动登录实现 本篇文章主要介绍"QQ模拟自动登录实现(带验证码)",主要涉及到java 实现QQ自动登录(带验证码)方面的内容,对于java 实现QQ自动登录(带验证码)感 ...

随机推荐

  1. mariadb设置utf8mb4

    1 . mysql真正的utf8是utf8mb4才是有效的utf8 a). mariaDB的设置方法 #vim /etc/my.conf [mysqld] character_set_server=u ...

  2. MyBatis动态SQL底层原理分析 与 JavaScript中的Date对象,以及UTC、GMT、时区的关系

    http://fangjian0423.github.io/categories/mybatis/ http://xtutu.me/the-date-object-in-js/

  3. 我希望早几年知道的5个Unix命令

    使用*nix系统已经有一段时间了.但还是有一些命令是被我一直忽略的,真希望我能早几年发现这些命令. 1. man ascii 这个命令会打印出八进制.十六进制和十进制的ASCII码表.难以置信我是一个 ...

  4. 2016.3.23 集成新版activiti-modeler(5.17+)到项目中

    书:<activiti实战> 博客: http://www.kafeitu.me/activiti/2013/03/10/integrate-activiti-modeler.html h ...

  5. 二叉查找树BST----java实现

                                                                    二叉查找树BST----java实现 1.二叉查找树简单介绍 二叉查找树 ...

  6. falsh,.swf文件修改z-index

    <object style="z-index:-1;"> <param name="wmode" value="transparen ...

  7. Oracle 修改带数据的字段类型

    http://www.cnblogs.com/LDaqiang/articles/1157998.html由于需求变动,现要将一个类型NUMBER(8,2)的字段类型改为 char.大体思路如下:   ...

  8. STL源代码剖析 容器 stl_vector.h

    本文为senlie原创.转载请保留此地址:http://blog.csdn.net/zhengsenlie vector --------------------------------------- ...

  9. sprint3 【每日scrum】 TD助手站立会议第四天

    站立会议 组员 昨天 今天 困难 签到 刘铸辉 (组长) 和楠哥学习了通过AlarmManager 来实现闹钟,由于要用到BroadcastReceiver广播协议,所以正在学习中,暂时只是按照教程写 ...

  10. Mysql或者Hive数据行变成列

    对于mysql /  hive 再进行统计的时候假设须要行变成列,能够使用函数 CASE 字段a WHEN 值b THEN c [WHEN d THEN e]* [ELSE f] END 当字段a=值 ...