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. hdu 4284 深度优先搜索

    思路:就是找能走的走,遍历一边所有情况,满足就退出. Accepted 4284 328MS 2280K 2239 B C++ //#pragma comment(linker, "/STA ...

  2. SAX - Hello World

    SAX 是一种事件驱动的 XML 数据处理模型.对于 DOM 模型,解析 XML 文档时,需要将所有内容载入内容.相比 DOM 模型,SAX 模型更为高效,它一边扫描一边解析 XML 文档.但与 DO ...

  3. Git CMD - merge: Join two or more development histories together

    命令格式 git merge [-n] [--stat] [--no-commit] [--squash] [--[no-]edit] [-s <strategy>] [-X <st ...

  4. Git CMD - log: Show commit logs

    命令参数 git log [<options>] [<revision range>] [[\--] <path>…​] 命令参数 --since=<date ...

  5. sqoop-1.4.6安装配置

    1. 下载sqoop-1.4.6并解压 wget http://archive.apache.org/dist/sqoop/1.4.6/sqoop-1.4.6.bin__hadoop-2.0.4-al ...

  6. Category

    Category 首先我们来谈谈Category. Objective-C提供了一种与众不同的方式——Catagory,可以动态的为已经存在的类添加新的行为.这样可以保证类的原始设计规模较小,功能增加 ...

  7. R语言diagram包画订单状态流图

    代码如下: library("diagram") #a <- read.table(file="clipboard",header=TRUE) write ...

  8. 搜索本地网络内所有可用的SQl实例

    '搜索本地网络内所有可用的SQl实例 Dim instance As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance Dim dt ...

  9. MySQL中用户授权/删除授权的方法

    用户授权方法 你可以通过发出GRANT语句增加新用户:  代码如下 复制代码 shell> mysql --user=root mysql mysql> GRANT ALL PRIVILE ...

  10. 【Leetcode】357. Count Numbers with Unique Digits

    题目描述: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. ...