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. Java - 正则表达式常用操作

    验证 简单验证 String regex = "\\d{4}-\\d{2}-\\d{2}"; String input = "2016-01-01"; asse ...

  2. CSS之图片关闭

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. 北大ACM(POJ1005-I Think I Need a Houseboat)

    Question:http://poj.org/problem?id=1005问题点:计算半圆面积及向上取整. Memory: 256K Time: 0MS Language: C++ Result: ...

  4. ios 多线程-GCD-NSOperation

    一.线程间的通讯 1.使用NSObject类的方法performSelectorInBackground:withObject:来创建一个线程. 具体的代码:隐式创建,自动启动 [Object per ...

  5. OC9_文件操作

    // // main.m // OC9_文件操作 // // Created by zhangxueming on 15/6/19. // Copyright (c) 2015年 zhangxuemi ...

  6. OC5_NSFileManger

    // // main.m // OC5_NSFileManger // // Created by zhangxueming on 15/6/19. // Copyright (c) 2015年 zh ...

  7. UEditor的使用方法

    文本编辑器程序员都会用到,今天无意中发现UEditor是个好东西,特奉献给大家,并提供下载. 这个编辑器的亮点是可以显示当前输入多少字符,还可以输入多少字符. 新创建的MVC项目,在layout页面里 ...

  8. 有道单词本添加js实现自动阅读单词

    个人比较习惯使用有道,使用了一段时间,背单词的时候很不方便   而有道单词客户Duan没有自动阅读的功能,  本菜用强大的js实现了简单的自动下一个单词的功能, 方法:第一步打开有道路径下的" ...

  9. vim全局替换

    :1,$ s/cmss_//g 1,$代表第一行到最后一行 s代表替换 cmss_为要替换的内容 替换为空格,所以直接// g代表全局替换

  10. 洛古 P1373 小a和uim之大逃离

    P1373 小a和uim之大逃离 题目提供者lzn 标签 动态规划 洛谷原创 难度 提高+/省选- 题目背景 小a和uim来到雨林中探险.突然一阵北风吹来,一片乌云从北部天边急涌过来,还伴着一道道闪电 ...