您的位置:首页 > 其它

[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



/*
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;
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: