博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
杭电ACM 2052 Picture
阅读量:4306 次
发布时间:2019-06-06

本文共 966 字,大约阅读时间需要 3 分钟。

Picture

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 16038    Accepted Submission(s): 8303
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
 
+---+ | | | | +---+
 
#include
int main(){ int n,m,i,j; while(scanf("%d%d",&m,&n)!=EOF) { printf("+"); for(i=1;i<=m;i++) printf("-"); printf("+\n"); for(i=1;i<=n;i++) { printf("|"); for(j=1;j<=m;j++) printf(" "); printf("|\n"); } printf("+"); for(i=1;i<=m;i++) printf("-"); printf("+\n"); printf("\n"); } return 0;}
 

转载于:https://www.cnblogs.com/NYNU-ACM/p/4237336.html

你可能感兴趣的文章
单例模式
查看>>
int(3)和int(11)区别
查看>>
201521123061 《Java程序设计》第十一周学习总结
查看>>
代码小思考
查看>>
Unity中的销毁方法
查看>>
ceph删除pool提示(you must first set the mon_allow_pool_delete config option to true)解决办法...
查看>>
2016-7-15(1)使用gulp构建一个项目
查看>>
文件上传案例——客户端和服务端套接字
查看>>
模拟BS服务器
查看>>
Lambda表达式——注重过程的编程思想
查看>>
网络通信和网络编程
查看>>
转换流
查看>>
序列化流
查看>>
线程池
查看>>
Junit单元测试
查看>>
Stream流思想和常用方法
查看>>
Stream流方法引用
查看>>
反射应用和获取Class对象的三种方式
查看>>
Spring框架
查看>>
JSP
查看>>