[2052]:Picture
2016-03-11 09:53
337 查看
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
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
/* author : Yangchengfeng */ #include<stdio.h> int main() { int n, m; while(scanf("%d%d", &m, &n)!=EOF){ int i, j, row = n+2, colomn = m+2; for(i=0; i<row; i++){ for(j=0; j<colomn; j++){ if(i==0 || i==n+1){ if(j==0 || j==m+1){ printf("+"); } else { printf("-"); } } else { if(j==0 || j==m+1){ printf("|"); } else { printf(" "); } } } printf("\n"); } printf("\n"); } return 0; }
相关文章推荐
- java基础之extends与implement
- 自动化测试如何解决验证码的问题
- opencv 帧差法 absdiff
- static、final、transient [ Java ]
- 一道sql面试题
- 中文分词+词向量化
- J2EE判断重复的数据
- Java配置----JDK开发环境搭建及环境变量配置
- 引用与指针
- Android面试题整理
- 欧拉项目第九题 Special Pythagorean triplet
- 设置TreePanel叶子结点允许append
- css动画——transition和animation
- iOS网络监测如何区分2、3、4G?
- 设置SVN忽略文件和目录(文件夹)
- 与运动相关的数据集
- float转换为二进制
- 解决WES 7 中Composite Bus找不到驱动的bug
- python中文字符乱码(GB2312,GBK,GB18030相关的问题)
- 0311复利计算2