2052Picture
来源:互联网 发布:linux ftp二进制命令 编辑:程序博客网 时间:2024/06/07 02:43
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 24666 Accepted Submission(s): 12554
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.
after each case, you should a blank line.
Sample Input
3 2
Sample Output
+---+| || |+---+
除了"+" 输入3 2 则有3个 “-” 2个“ | ” 注意每组输出中间有一个空行
#include<iostream>#include<cstdio>using namespace std;int main(){int n,m;while(scanf("%d%d",&n,&m)!=EOF){for(int i=0 ;i<m+2 ;i++){for(int j=0 ;j<n+2 ;j++){if((i==0&&j==0)||(i==m+1&&j==0)){printf("+");}else if((i==0&&j==n+1||(i==m+1&&j==n+1))){printf("+\n");}else if(j==0){printf("|");}else if(j==n+1){printf("|\n");}else if(i==0||i==m+1){printf("-");}else{printf(" ");}} }printf("\n"); }return 0;}
0 0
- 2052 Picture
- Picture 2052
- 2052 Picture
- [2052]:Picture
- 2052Picture
- 2052picture
- HDOJ 2052 Picture
- hdu 2052 picture
- Hdu 2052 - Picture
- HDU 2052 Picture
- HDU 2052 Picture
- HDU 2052 - Picture
- 杭电 2052 Picture
- 2052——Picture
- HDUJ 2052 Picture 模拟
- HDU 2052 Picture
- Picture hdoj 2052
- hdoj.2052 Picture 20140804
- Linux 学习_在虚拟机上面安装RedHat 9(图+文)
- Google Protocol Buffer 的使用和原理
- MATLAB R2014a完全自学一本通 pdf电子书下载地址
- 同一进程中的线程究竟共享哪些资源
- PHP页面上输出空白隐形字符65279解决办法
- 2052Picture
- git快速入门
- (12)关于性能测试问题解答篇(下)
- 第一篇,ethercat 硬件初始化 HW_Init(void)
- Java I/O操作
- Elasticsearch java API (17)Aggregations 聚合 函数
- 用dwz+springmvc出现这个问题Http status: 200 OK ajaxOptions: parsererror thrownError
- 关于Hibernate中创建ServiceRegistry对象时找不到ServiceRegistryBuilder对象的问题
- 忘了她,就像忘了一朵花