HDU 4716 A Computer Graphics Problem
A Computer Graphics Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 336 Accepted Submission(s): 277
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.
For each test case there is a single line with a number x. (0 < x < 100, x is a multiple of 10)
See sample output for more details.
0
60
*------------*
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
|............|
*------------*
Case #2:
*------------*
|............|
|............|
|............|
|............|
|------------|
|------------|
|------------|
|------------|
|------------|
|------------|
*------------*
import java.io.*;
import java.util.*;
public class Main { public static void main(String[] args) throws IOException{
new Main().work();
}
void work() throws IOException{
BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
//PrintWriter pw=new PrintWriter(new OutputStreamWriter(System.out),true);
int t=Integer.parseInt(bu.readLine());
for(int j=1;j<=t;j++){
System.out.println("Case #"+j+":");
int x=Integer.parseInt(bu.readLine());
first();
int m=x/10;
for(int i=0;i<10-m;i++){
second();
}
for(int i=0;i<m;i++){
fir();
}
first();
}
}
void fir(){
System.out.print("|");
for(int i=0;i<12;i++){
System.out.print("-");
}
System.out.print("|");
System.out.println();
}
void second(){
System.out.print("|");
for(int i=0;i<12;i++){
System.out.print(".");
}
System.out.print("|");
System.out.println();
}
void first(){
System.out.print("*");
for(int i=0;i<12;i++){
System.out.print("-");
}
System.out.print("*");
System.out.println();
}
}
HDU 4716 A Computer Graphics Problem的更多相关文章
- HDU 4716 A Computer Graphics Problem (水题)
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- HDU 4716 A Computer Graphics Problem 2013年四川省赛题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 题目大意不用解释了吧,看案例就能明白 #include<cstdio> #inclu ...
- 水题 HDOJ 4716 A Computer Graphics Problem
题目传送门 /* 水题:看见x是十的倍数就简单了 */ #include <cstdio> #include <iostream> #include <algorithm ...
- HDUOJ----A Computer Graphics Problem
A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J ...
- HDU-4716 A Computer Graphics Problem 水题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 直接搞.. //STATUS:C++_AC_0MS_288KB #include <fun ...
- Mathematics for Computer Graphics数学在计算机图形学中的应用 [转]
最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=10509 [译]Mathematics for Computer Gra ...
- Mathematics for Computer Graphics
Mathematics for Computer Graphics 最近严重感觉到数学知识的不足! http://bbs.gameres.com/showthread.asp?threadid=105 ...
- Mesa (computer graphics)
http://en.wikipedia.org/wiki/Mesa_(computer_graphics) Mesa (computer graphics) From Wikipedia, the f ...
- Computer Graphics Research Software
Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009! Last update ...
随机推荐
- BZOJ 1801: [Ahoi2009]chess 中国象棋( dp )
dp(i, j, k)表示考虑了前i行, 放了0个炮的有j列, 放了1个炮的有k列. 时间复杂度O(NM^2) -------------------------------------------- ...
- mysql 正确的关闭方式
./bin/mysqladmin -uroot -p123456 -S /home/allen/var/mysql/mysql.sock shutdown
- java——String的那边破事
经典的先看下面一段代码,请问最终创建几个对象,分别在哪里? String s0 = new String("luoliang.me"); String s1 = "luo ...
- JS中小数的差,比较大小
var a = 0.3-0.2; -0.3; alert(a + "&" + b); if (a == b) { alert("true"); } el ...
- 简单OC程序
Foundation框架头文件的路径 1> 右击Xcode.app --> 显示包内容 2> Xcode.app/Contents/Developer/Platforms/iP ...
- “-Xmx1024m -Xms1024m -Xmn512m -Xss256k”——Java运行参数(转)
JVM的堆的内存, 是通过下面面两个参数控制的 -Xms 最小堆的大小, 也就是当你的虚拟机启动后, 就会分配这么大的堆内存给你 -Xmx 是最大堆的大小 当最小堆占满后,会尝试进行GC,如果GC之后 ...
- 《windows程序设计》学习_2.1:初识消息
#include <windows.h> //#define WM_MYMSG (WM_USER +100) LRESULT CALLBACK WndProc(HWND,UINT,WPAR ...
- c#SocketIO4NetClient访问node js
提到Node,不能错过的是WebSocket协议.它与Node之间的配合堪称完美,其理由有两条. 1.WebSocket客户端基于时间的编程模型与Node中自定义事件相差无几. 2.WebSocket ...
- 第七届河南省赛G.Code the Tree(拓扑排序+模拟)
G.Code the Tree Time Limit: 2 Sec Memory Limit: 128 MB Submit: 35 Solved: 18 [Submit][Status][Web ...
- 实验记录一 初步接触cortex-M3
应该说老早就在接触cortex-M3了.曾经没想到会接触嵌入式,结果由于导师的缘故.在选择项目管理时,就呵呵了.不废话.搭配环境非常easy,纯粹傻瓜式.可由于自己的马虎,却让自己一直困惑. 记得在前 ...