HDU 2052 Picture

来源:互联网 发布:淘宝贷款不换会怎么样 编辑:程序博客网 时间:2024/04/29 20:45

/*
中文题意:
中文翻译:
题目大意:
解题思路:
难点详解:
关键点:
解题人:lingnichong
解题时间:2014/08/05    15:53
解题感受:水题、第一类填数、换图类,比较简单
*/




Picture

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 16105    Accepted Submission(s): 8340


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
xhd
 

Source
校庆杯Warm Up
 


#include<stdio.h>int main(){int n,m;while(~scanf("%d%d",&n,&m)){int i,j;for(i=1;i<=m+2;i++)//控制行数 {for(j=1;j<=n+2;j++)//控制列数 {if(i==1&&j==1||i==1&&j==n+2||i==m+2&&j==1||i==m+2&&j==n+2)printf("+");else if(i==1||i==m+2)printf("-");else if(j==1||j==n+2)printf("|");elseprintf(" ");}printf("\n");}printf("\n");}return 0;}




0 0
原创粉丝点击