杭电acm--2052

来源:互联网 发布:caffe loss大小 编辑:程序博客网 时间:2024/05/17 02:41



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.



#include<stdio.h>#include<stdlib.h>#include<math.h>//#include<string.h>//#define P 3.141592653void main(){int n, m;while (scanf("%d%d", &n, &m) != EOF){if (n < 0 || m >= 75)break;printf("+");for (int i = 0; i < n; i++)printf("-");printf("+\n");for (int j = 0; j < m; j++){printf("|");for (int i = 0; i < n; i++)printf(" ");printf("|\n");}printf("+");for (int i = 0; i < n; i++)printf("-");printf("+\n");printf("\n");}system("pause");}


0 0
原创粉丝点击