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. Elasticsearch搜索结果返回不一致问题

    一.背景 这周在使用Elasticsearch搜索的时候遇到一个,对于同一个搜索请求,会出现top50返回结果和排序不一致的问题.那么为什么会出现这样的问题? 后来通过百度和google,发现这是因为 ...

  2. [译]在IB中实现自动布局

    有关自动布局的其他文章: Autolayout Visual format language for autolayout Creating individual constraints 可怜的界面编 ...

  3. 【spring boot】12.spring boot对多种不同类型数据库,多数据源配置使用

    2天时间,终于把spring boot下配置连接多种不同类型数据库,配置多数据源实现! ======================================================== ...

  4. docker入门小结(三)

    本次笔记主要记录教程中的几个实战案例的实际情况 1,使用supervisor管理进程 忘了截图了,就不写了.教程中写的比较清楚. 但是注意,如果刚刚学习了上一章的网络配置,需要将网络的forward打 ...

  5. Python标准库:1. 介绍

    标准库包括了几种不同类型的库. 首先是那些核心语言的数据类型库,比方数字和列表相关的库.在核心语言手冊里仅仅是描写叙述数字和列表的编写方式,以及它的排列,而未定义它的语义. 换一句话说,核心语言手冊仅 ...

  6. Andfix热修复框架原理及源代码解析-上篇

    热补丁介绍及Andfix的使用 Andfix热修复框架原理及源代码解析-上篇 Andfix热修复框架原理及源代码解析-下篇 1.不知道怎样使用的同学,建议看看我上一篇写的介绍热补丁和Andfix的使用 ...

  7. 【经验】使用Profiler工具分析内存占用情况

    Unity3D为我们提供了一个强大的性能分析工具Profiler.今天我们就使用Profiler来具体分析一下官方样例AngryBots的内存使用信息数据. 首先打开Profiler选择Memory选 ...

  8. HDOJ 2829 Lawrence

    四边形不等式优化DP Lawrence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  9. select设置innerHMTL

    select控件在标准浏览器下可以直接innerHTML设置内容,IE则不行. HTML结构: <form name="form1"> <select name= ...

  10. 19:ReverseNumber数字颠倒

    题目描述 描述:输入一个整数,将这个整数以字符串的形式逆序输出 程序不考虑负数的情况,若数字含有0,则逆序形式也含有0,如输入为100,则输出为001 输入描述:输入一个int整数 输出描述:将这个整 ...