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 ...
随机推荐
- 星际地图制作中OB无建筑 退出问题
星际地图制作中OB玩家没有建筑强制退出问题,目前 用下面的方法解决 ob玩家分到一个组,触发里面 延时几秒 我设置的2秒 KILL掉这个组的建筑就行~
- 工作日志2014-06-10(实现C语言解析XML获得查询关键字)
#include "GetInfo.h" ]; int GetInfoToWrite(char* path, char* domain,Write_t* pwrite); int ...
- Java—异常处理总结
异常处理是程序设计中一个非常重要的方面,也是程序设计的一大难点,从C开始,你也许已经知道如何用if...else...来控制异常了,也许是自发的,然而这种控制异常痛苦,同一个异常或者错误如果多个地方出 ...
- COB(Chip On Board) 工艺技术
COX(Chip On X) •X 基板: PCB (Printed circuit board) FPC (Flexible Printed Circuit) Glass •导线焊接 球形焊接 ...
- chrome extensions
chrome web store AppsGamesExtensionsThemes CATEGORIES All FEATURESClear Runs Offline By ...
- 张王李相亲应用if else
package hello; public class to { public static void main(String[]args){ int a =1,b=0; int c =1,d=0; ...
- maven项目启动
1服务install 2 build (tomcat:run)
- Javascript初级学习总结
首先,在Html页面输出,使用document.write('内容'); <html> <head> <title></title> <scrip ...
- eclipse或adt-bundle创建的android项目没有自动生成MainActivity.java和activity_main.xml等文件解决办法
以前我电脑一直以来都是用的eclipse3.7来开发android项目的,创建android项目也能正常生成MainActivity.java和activity_main.xml等文件.后来不知道什么 ...
- p95 3.5、3.8
3.5 有一农夫带一条狼,一只羊和一筐菜欲从河的左岸乘船到右岸,但受下列条件限制:(1)船太小,农夫每次只能带一样东西过河:(2)如果没有农夫看管,则狼要吃羊,羊要吃菜.请设计一个过河方案,是的农夫 ...