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. Loj #6142. 「2017 山东三轮集训 Day6」A

    link: https://loj.ac/problem/6142 推完一波式子之后发现求的是:ΣC(N,i)^2, 其中i是偶数. 然后就可以卢卡斯乱搞了,分奇偶和之前的答案合并就好了233. #i ...

  2. php 技术知识点汇总

    consul : 服务发现 做服务发现的框架常用的有 zookeeper eureka etcd consul zookeeper,  php中的libzookeeper PHP使用 swagger ...

  3. [Cocoa]深入浅出Cocoa多线程编程之 block 与 dispatch quene

    深入浅出 Cocoa 多线程编程之 block 与 dispatch quene 罗朝辉(http://www.cppblog.com/kesalin CC 许可,转载请注明出处 block 是 Ap ...

  4. HDU1421

    提交啦n次一直WA,这个bug找啦几个小时,最终才发现数组开小啦,真是遗憾.这是一个典型的DP问题,题目要求从n个中选出k对使得最终疲劳度最小.首先对物品质量a[n]进行一次排序,用dp[i][j]表 ...

  5. 修改linux iptable规则

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT(允许80端口通过防火墙)-A INPUT -m state --sta ...

  6. 每天5道面试题(二)java基础

    说出Servlet的生命周期,并说出Servlet和CGI的差别 Servlet被server实例化后,容器执行其init方法,请求到达时执行其service方法,service方法自己主动派遣执行与 ...

  7. pythonkeywordis与 ==的差别

    pythonkeywordis与 ==的差别 近期在学习Python.总结一下小知识点. Python中的对象包括三要素:id.type.value 当中id用来唯一标识一个对象.type标识对象的类 ...

  8. Oracle 查询一个表的所有字段

    select * from user_tab_columns where table_name = 'T_B_CLIENT_MSG'

  9. C语言数据类型的转换

    C语言的类型转换,一个是强制类型进行转换,而在这里要介绍的是自动的数据类型的转换,自动的数据类型转换很多时候是发生在多种数据类型混合使用的时候就会进行类型的转换,这样就会带来不能控制的结果,所以必须进 ...

  10. UIView属性的动画

    //标记着动画块的开始,第一个参数表示动画的名字,起到标识作用 [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDurat ...