Hdu 2052 Picture

Picture

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


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<iostream>
using namespace std;
int main()
{
    int m,n,i,j;
    while(cin>>m>>n)
    {
        {
            cout<<"+";
            for(i=1; i<=m; i++)
                cout<<"-";
            cout<<"+"<<endl;
            for(i=1; i<=n; i++)
            {
                cout<<"|";
                for(j=1; j<=m; j++)
                    cout<<" ";
                cout<<"|"<<endl;
            }
            cout<<"+";
            for(i=1; i<=m; i++)
                cout<<"-";
            cout<<"+"<<endl<<endl;
        }
    }
    return 0;
}





下载前必看:https://pan.quark.cn/s/744f26e0d658 标题“安良H3D 多功能限时继电器.pdf”中的知识点涉及继电器的技术细节和功能特性。 继电器是一种电控制装置,广泛应用于电子、电力、自动化及通信系统中,其主要功能是在输入电路中由小功率控制大功率电路的一种自动开关。 限时继电器则是具备时间控制功能的继电器,可以在设定时间后延迟动作或是在设定时间内动作,从而实现时间控制。 从描述和标签“安良H3D 多功能限时继电器pdf, 安良H3D 多功能限时继电器”中,可以推测这份PDF文件是对特定型号H3D继电器的技术说明文档,它强调了该继电器的多功能特性,意味着该设备不仅仅是简单的定时器,可能还集成了多种功能,例如过载保护、故障报警、远程控制等。 标签“综合资料”则表明这是一份综合性的技术资料,为使用者提供全面的继电器信息。 关于文档中部分内容的分析,虽然文档信息不是完全准确,但可以推断其描述了该继电器的相关技术参数、功能应用和操作说明。 以下是对这部分内容的详细解读:继电器名称“H3D-M”表明这是安良公司生产的H3D型号系列中的M型继电器。 文档中提到的“使用了H3D-M继电器”可能说明该文档提供了该型号继电器的具体应用案例或示例。 接着,“价值了H3D-M继电器”可能是指H3D-M继电器被使用或实现的功能。 从上下文看,这些功能包括定时控制、安全保护、远程通信等。 在安全保护方面,继电器可实现过载保护,防止系统过载引发的故障。 远程通信则意味着该继电器可能具备网络接口,能通过网络接受控制指令或发送状态信息。 文档中还提到“实现了H3D-M继电器的多种功能”,表明继电器集成了多项功能,如可以进行定时控制、保护和信号采集等多种操作。 这说明继电器不仅具有基本的...
第五届广西省大学生程序设计竞赛K Kirby's challenge(AC代码) 分数 300 作者 Colin 单位 杭州电子科技大学 Description Recently, Colin bought a Switch for Eva. And they are playing "Kirby and the Forgotten Land". In a challenge mission, Kirby is in a 4×n grid. The row of it is numbered from 1 to 4, and the column of it is numbered from 1 to n. There are many keys in this grid. Let a x,y ​ represent the status of cell (x,y). If a x,y ​ =1, there is a key in (x,y). If a x,y ​ =0, there is no key in (x,y). Kirby starts at (1,1), and should reach (4,n). Moreover, Kirby must collect all the keys in the grid to open the door in (4,n). Kirby will collect the key at (x,y) when Kirby reach (x,y). Of course, Kirby will collect the key at (1,1) at the beginning. In a second, Kirby can move from (x,y) to (x+1,y),(x,y+1),(x−1,y). Or Kirby can stay at (x,y) and throw a returnable flying weapon(boomerang) to collect keys in the flying path. Kirby has two ways to throw the weapon. As the picture shows: image-20220604213457062.png The flying path is represented as the grey cells, so keys in the grey cells can be collected by the weapon. In a second, Kirby can only choose one way to throw the weapon, but Kirby can throw the weapon multiple times at (x,y) if necessary. Notice: Kirby can't get off the grid, but the weapon can fly outside the grid and keep the flying path. Please write a program to help Colin and Eva find the shortest time to complete the challenge mission, so that they can get more rewards. Input The first line contains one integer n (1≤n≤100). In the next 4 lines, the x-th line contains n integers a x,1 ​ ,a x,2 ​ ,⋯,a x,n ​ (0≤a x,y ​ ≤1). Output Print one integer representing the minimum number of seconds required to complete the challenge mission. Sample input 1 5 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 0 1 output 1 8 The best solution is: Spend 1 second to throw the weapon in the second way at (1,1), and spend 7 seconds to reach (4,5). 代码长度限制 16 KB 时间限制 1000 ms 内存限制 512 MB 栈限制 131072 KB
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值