zoukankan      html  css  js  c++  java
  • 杭电ACM 2052 Picture

    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<stdio.h>
    int main()
    {
    	int n,m,i,j;
    	while(scanf("%d%d",&m,&n)!=EOF)
    	{
    		printf("+");
    		for(i=1;i<=m;i++)
    			printf("-");
    		printf("+
    ");
    		for(i=1;i<=n;i++)
    		{
    			printf("|");
    			for(j=1;j<=m;j++)
    				printf(" ");
    			printf("|
    ");
    		}
    		printf("+");
    		for(i=1;i<=m;i++)
    			printf("-");
    		printf("+
    ");
    		printf("
    ");
    	}
    	return 0;
    }

     
  • 相关阅读:
    P5331 [SNOI2019]通信
    P3700 [CQOI2017]小Q的表格
    Linux
    P3268 [JLOI2016]圆的异或并
    P3317 [SDOI2014]重建
    P5492 [PKUWC2018]随机算法
    P3210 [HNOI2010]取石头游戏
    支配树
    P5401 [CTS2019]珍珠
    P4027 [NOI2007]货币兑换
  • 原文地址:https://www.cnblogs.com/NYNU-ACM/p/4237336.html
Copyright © 2011-2022 走看看