http://www.bnuoj.com/bnuoj/problem_show.php?pid=27987

【题意】:给定坐标输出图形

【题解】:处理坐标上的小技巧

【code】:

 #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h> using namespace std; #define N 100 char str[N*][N*]; void init()
{
int i,j;
for(i=;i<;i++)
{
for(j=;j<;j++)
{
str[i][j]='.';
if(i==)
{
str[i][j]='-';
}
if(j==)
{
str[i][j]='|';
}
if(i==&&j==)
{
str[i][j]='+';
}
}
}
} int main()
{
int t;
scanf("%d",&t);
init();
int x1=,y1=,x2=-,y2=-;
while(t--)
{
int x,y;
scanf("%d%d",&y,&x);
x=-x;
x+=;
y+=;
if(x1>x) x1=x;
if(y1>y) y1=y;
if(x2<x) x2=x;
if(y2<y) y2=y;
str[x][y]='*';
}
if(x1>) x1=;
if(y1>) y1=;
if(x2<) x2=;
if(y2<) y2=;
int i,j;
for(i=x1;i<=x2;i++)
{
for(j=y1;j<=y2;j++)
{
putchar(str[i][j]);
}
putchar();
}
return ;
}

bnuoj 27987 Record of the Attack at the Orbit (模拟)的更多相关文章

  1. URAL 1942 Attack at the Orbit

    B - Attack at the Orbit Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & % ...

  2. URAL 1944 大水题模拟

    D - Record of the Attack at the Orbit Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format ...

  3. bnuoj 29368 Check the Identity(栈)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=29368 [题解]:模拟,然后对x,进行枚举,看是否所有都满足条件 [code]: #include ...

  4. bnuoj 29373 Key Logger(模拟双向队列)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=29373 [题意]:模拟光标输入 [题解]:用双向列表模拟实现,这里用其他模拟会超时,注意内存的释放 ...

  5. UDP flood UDP Port Denial-of-Service Attack

    https://baike.baidu.com/item/UDP%20flood/5504851 UDPFlood是日渐猖厥的流量型DoS攻击,原理也很简单.常见的情况是利用大量UDP小包冲击DNS服 ...

  6. 使用 Python 进行稳定可靠的文件操作

    程序需要更新文件.虽然大部分程序员知道在执行I/O的时候会发生不可预期的事情,但是我经常看到一些异常幼稚的代码.在本文中,我想要分享一些如何在Python代码中改善I/O可靠性的见解. 考虑下述Pyt ...

  7. kafka同步异步消费和消息的偏移量(四)

    1. 消费者位置(consumer position) 因为kafka服务端不保存消息的状态,所以消费端需要自己去做很多事情.我们每次调用poll()方法他总是返回已经保存在生产者队列中还未被消费者消 ...

  8. [POC]SuiteCRM 7.10.7 - 'record' SQL Injection

    #################################################################### # Exploit Title: SuiteCRM - 're ...

  9. Identifying a distributed denial of service (DDOS) attack within a network and defending against such an attack

    The invention provides methods, apparatus and systems for detecting distributed denial of service (D ...

随机推荐

  1. QTREE 树链剖分---模板 spoj QTREE

    <树链剖分及其应用> 一文讲得非常清楚,我一早上就把他学会了并且A了这题的入门题. spoj QTREE 题目: 给出一棵树,有两种操作: 1.修改一条边的边权. 2.询问节点a到b的最大 ...

  2. 转:java服务器安全指南

    转: http://drops.wooyun.org/web/16609 JAVA安全之JAVA服务器安全漫谈 z_zz_zzz · 2016/06/08 10:50 0x00 前言 本文主要针对JA ...

  3. java的回忆录

    封装的三步骤:(1)加属性(成员变量.全局变量.域field)用private来修饰(2)为对应的属性生成共有的setter.getter方法(3)在对应的setter的方法中可以根据需要加入对应的验 ...

  4. IP地址计算和划分

    一.      B类地址 范围从128-191(第一串8位二进制10000000~10111111),如172.168.1.1,第一和第二段号码为网络号码,剩下的2段号码为本地计算机的号码.转换为2进 ...

  5. SharePoint 2013 网站定义中添加页面布局

    今天在Visual Studio 2012中将页面布局打包到网站定义中. 新建Module “MasterPageGallary” 在Element中如下: <Elements xmlns=&q ...

  6. WCF配置文件详解 【转】

    ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ...

  7. HTML JSOgN to string

    JSON.stringify(json).replace(',', ', ').replace('[', '').replace(']', '')

  8. PowerDesigner16.5 生成SQL脚本执行出错:collate chinese_prc_ci_as

    PowerDesigner16.5 生成SQL脚本执行出错, collate chinese_prc_ci_as 点DataBase-edit current dbms —— 左边Script - O ...

  9. sql中的触发器、视图、事务

    ·触发器(trigger) [触发器本质上还是一个存储过程,只不过不是用exe来调用执行,而是通过增删改数据库的操作] [触发器只对增.删.改有效] 触发器的格式 (instead of与for的区别 ...

  10. 让.NET程序会说话

    在开发过程中需要用到让程序自动播放语音,如果是一个一个录则太麻烦了,在开发过程中发现.NET已经自带了该功能 Type type = Type.GetTypeFromProgID("SAPI ...