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 ...
随机推荐
- mysql批量上传数据
private object BlubckMysql(List<xiaoyao_blogs_pictureModel> list, string connect) { var sqllis ...
- C++中的string
要想使用标准C++中string类,必须要包含 #include <string>// 注意是<string>,不是<string.h>,带.h的是C语言中的头文件 ...
- bzoj 1085: [SCOI2005]骑士精神 IDA*
题目链接 给一个图, 目标位置是确定的, 问你能否在15步之内达到目标位置. 因为只有15步, 所以直接ida* #include<bits/stdc++.h> using namespa ...
- AngularJS bootStraping
看这个 http://www.dotnet-tricks.com/Tutorial/angularjs/5aWL261214-Understanding-AngularJS-Bootstrap-Pro ...
- linux内核升级图文攻略
Linux内核概览 Linux是一个一体化内核(monolithic kernel)系统. 设备驱动程序可以完全访问硬件. Linux内的设备驱动程序可以方便地以模块化(modularize)的形式设 ...
- 经典灰鸽子lcx
方法1路由配置 在路由器配置 进入虚拟服务器 填入ip 端口 就可以了方法2内网域名解析想以前的花生客 科迈都有这项免费业务但现在基本不提供了如果那个网站还有内网解析的功能 大家一定要发上来哦方法3p ...
- Codeforces 713C Sonya and Problem Wihtout a Legend(单调DP)
[题目链接] http://codeforces.com/problemset/problem/713/C [题目大意] 给出一个数列,请你经过调整使得其成为严格单调递增的数列,调整就是给某些位置加上 ...
- DrawerLayout、CoordinatorLayout、CollapsingToolbarLayout的使用--AndroidSupportDesign练手
先po一张效果图 PS:原谅题主的懒惰吧.. 看着是不是很酷炫,那是因为5.0的动画做得好,代码其实没有多少,搞清楚这个布局的层次关系很重要. 废话不多说了,先来看布局文件 最外层是一个DrawerL ...
- gdb篇
转自:http://www.cnblogs.com/ypchenry/p/3668572.html 1.gdb的原理 熟悉linux的同学面试官会问你用过gdb么?那好用过,知道gdb是怎么工作的么? ...
- css3的一些属性
以前还没有注意过css的一些属性,近期发现有一些样式很好用,现在整理一遍. CSS3 动画属性 @keyframes : 规定动画 可以通过keyframes 改变一个块的样式当然这是要配合anima ...