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. CentOS 6.6下Redis安装

    安装redis的过程非常的简单,具体参考教程官网:http://redis.io/download 1.下载并安装 下载的redis-3.2.5.tar.gz安装包默认在/usr/local/src/ ...

  2. Android中IntentService的原理及使用

    在Android开发中,我们或许会碰到这么一种业务需求,一项任务分成几个子任务,子任务按顺序先后执行,子任务全部执行完后,这项任务才算成功.那么,利用几个子线程顺序执行是可以达到这个目的的,但是每个线 ...

  3. 如何设置Win7系统中的上帝模式GodMode(转载)

    如何设置Win7系统中的上帝模式GodMode(转载) NT6系统中隐藏了一个秘密的“GodMode”,字面上译为“上帝模式”.God Mode其实就是一个简单的文件夹窗口,但包含了几乎所有系统的设置 ...

  4. xheditor上传图片的java实现

    最近一个项目中因为框架的原因,很多文本编辑器都不兼容,最后找到xheditor,这个富文本编辑器的确不错,功能基本都能满足,只是上传图片的java接口需要自己写,因此,测试了两种方法,最终成功.分享给 ...

  5. Cocos2d-x中创建SQLite数据库

    我们下边介绍如何通过SQLite3提供的API实现MyNotes数据库创建.创建数据库一般需要经过如下三个步骤.(1) 使用sqlite3_open函数打开数据库.(2) 使用sqlite3_exec ...

  6. C++函数模板本质-学习入门

    template<typename T> void mySwap(T &a, T &b) { T c; c = a; a = b; b = c; } int main() ...

  7. 5中方式实现String反转

    这里介绍Java中5中实现String反转的方式. 一.数组实现String反转 //数组实现String反转 public String reverseByArray(){ if(str == nu ...

  8. Gitlab 与 Git Windows 客户端一起使用的入门流程

    我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3824934.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...

  9. CICS日志---内存问题

    Level 9 COCITOOL_XA: Connected! [2014-01-09 19:46:24.296834][22347888] Level 0 TestPerormence: GDAO ...

  10. JS 正则 获取URL参数

    function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&] ...