A Computer Graphics Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 92    Accepted Submission(s): 80

Problem Description
In this problem we talk about the study of Computer Graphics. Of course, this is very, very hard. We have designed a new mobile phone, your task is to write a interface to display battery powers. Here we use '.' as empty grids. When the battery is empty, the interface will look like this:

*------------*
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
*------------*

When the battery is 60% full, the interface will look like this:

*------------* 
|............|
|............|
|............|
|............|
|------------|
|------------|
|------------|
|------------|
|------------|
|------------|
*------------*

Each line there are 14 characters. Given the battery power the mobile phone left, say x%, your task is to output the corresponding interface. Here x will always be a multiple of 10, and never exceeds 100.

 
Input
The first line has a number T (T < 10) , indicating the number of test cases. For each test case there is a single line with a number x. (0 < x < 100, x is a multiple of 10)
 
Output
For test case X, output "Case #X:" at the first line. Then output the corresponding interface. See sample output for more details.
 
Sample Input
2
0
60
 
Sample Output
Case #1:
*------------*
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
*------------*
Case #2:
*------------*
|............|
|............|
|............|
|............|
|------------|
|------------|
|------------|
|------------|
|------------|
|------------|
*------------*
 
Source
简单题:
代码:
 #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int i,j,t,n,cnt;
scanf("%d",&t);
for(cnt=;cnt<=t;cnt++)
{
scanf("%d",&n);
printf("Case #%d:\n",cnt);
for(i=;i<;i++)
{
for(j=;j<;j++)
{
if(i==||i==)
{
if(j==||j==)
printf("*");
else
printf("-");
}
else
if(j==||j==)
printf("|");
else
if(i<=-n/)
printf(".");
else
printf("-");
}
puts("");
}
}
return ;
}

HDUOJ----A Computer Graphics Problem的更多相关文章

  1. 水题 HDOJ 4716 A Computer Graphics Problem

    题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...

  2. HDU 4716 A Computer Graphics Problem

    A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  3. HDU 4716 A Computer Graphics Problem (水题)

    A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  4. HDU-4716 A Computer Graphics Problem 水题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 直接搞.. //STATUS:C++_AC_0MS_288KB #include <fun ...

  5. HDU 4716 A Computer Graphics Problem 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 题目大意不用解释了吧,看案例就能明白 #include<cstdio> #inclu ...

  6. Mathematics for Computer Graphics数学在计算机图形学中的应用 [转]

    最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=10509 [译]Mathematics for Computer Gra ...

  7. Mathematics for Computer Graphics

    Mathematics for Computer Graphics 最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=105 ...

  8. Mesa (computer graphics)

    http://en.wikipedia.org/wiki/Mesa_(computer_graphics) Mesa (computer graphics) From Wikipedia, the f ...

  9. Computer Graphics Research Software

    Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...

随机推荐

  1. 基于Android的ELF PLT/GOT符号重定向过程及ELF Hook实现(by 低端码农 2014.10.27)

    引言 写这篇技术文的原因,主要有两个: 其一是发现网上大部分描写叙述PLT/GOT符号重定向过程的文章都是针对x86的.比方<Redirecting functions in shared EL ...

  2. GNU GRUB

    Introduction GNU GRUB is a Multiboot boot loader. It was derived from GRUB, the GRand Unified Bootlo ...

  3. JMS基本概念之一

    The Java Message Service(JMS) API is a messaging standard that allows application components based o ...

  4. VueJS如何引入css或者less文件的一些坑

    我们在做Vue+webpack的时,难免会引入各种公共css样式文件,那么我们改如何引入呢?引入时会有那些坑呢? 首先,引入公共样式时,我们在“main.js”里使用AMD的方式引入,即 requir ...

  5. Anagrams leetcode java

    题目: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will ...

  6. Socket.IO介绍:支持WebSocket、用于WEB端的即时通讯的框架

    一.基本介绍 WebSocket是HTML5的一种新通信协议,它实现了浏览器与服务器之间的双向通讯.而Socket.IO是一个完全由JavaScript实现.基于Node.js.支持WebSocket ...

  7. 关于vue单页面应用总是先出现主页一闪而过的现象

    问题描述:每次强制刷新登陆页面时,总是会出现主页一闪而过的现象,如果主页上有请求,还会请求后台数据.感觉不太正常,所以想到研究下为什么,然后去掉这个主页一闪而过的现象 1.先看下我之前的app的rou ...

  8. URAL 1698

    题目大意:统计位数不大于n的自守数的个数. KB     64bit IO Format:%I64d & %I64u 数据规模:1<=n<=2000. 理论基础: 自守数:参见链接 ...

  9. Netdata Linux下性能实时监测工具

    导读 本文将介绍一款非常好用的工具——Netdata,这是一款Linux性能实时监测工具,为一款开源工具,我对其英文文档进行了翻译,水平有限,有翻译错误的地方欢迎大家指出,希望本文对大家有所帮助,谢谢 ...

  10. 【nodejs】理想论坛帖子下载爬虫1.06

    //====================================================== // 理想论坛帖子下载爬虫1.06 // 循环改成了递归,但最多下载千余文件就崩了 / ...