A Computer Graphics Problem

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

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
 
Recommend
zhuyuanchen520
 

大水题一发

就是拼手速

 /* ***********************************************
Author :kuangbin
Created Time :2013-9-11 12:01:07
File Name :2013-9-11\1001.cpp
************************************************ */ #include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int iCase = ;
int T;
int n;
scanf("%d",&T);
while(T--)
{
iCase++;
printf("Case #%d:\n",iCase);
scanf("%d",&n);
printf("*");
for(int i = ;i < ;i++)printf("-");
printf("*\n");
int t = n/;
for(int i = ;i < -t;i++)
{
printf("|");
for(int j = ;j < ;j++)printf(".");
printf("|\n");
}
for(int i = ;i < t;i++)
{
printf("|");
for(int j = ;j < ;j++)printf("-");
printf("|\n");
}
printf("*");
for(int i = ;i < ;i++)printf("-");
printf("*\n"); }
return ;
}

HDU 4716 A Computer Graphics Problem (水题)的更多相关文章

  1. HDU 4716 A Computer Graphics Problem

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

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

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

  3. HDU-4716 A Computer Graphics Problem 水题

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

  4. 水题 HDOJ 4716 A Computer Graphics Problem

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

  5. HDU 5170 GTY's math problem 水题

    题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5170 bc(中文):http://bestcoder.hdu.edu.cn/contests ...

  6. HDUOJ----A Computer Graphics Problem

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

  7. HDU 2096 小明A+B --- 水题

    HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen(&quo ...

  8. hdu 2117:Just a Numble(水题,模拟除法运算)

    Just a Numble Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Tot ...

  9. hdu 2050:折线分割平面(水题,递归)

    折线分割平面 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

随机推荐

  1. 安卓ios各版本及分辨率占比

    Google Play 安装统计数据 只有安卓的 https://developer.android.com/about/dashboards/index.html?hl=zh-cn 腾讯移动分析 安 ...

  2. linux内核之accept实现

    用户态对accept的标准用法: if ((client_fd = accept(sockfd, (struct sockaddr *)&remote_addr, &sin_size) ...

  3. mybatis之 # 与 $ 区别以及 sql 预编译

    mybatis 中使用 sqlMap 进行 sql 查询时,经常需要动态传递参数,例如我们需要根据用户的姓名来筛选用户时,sql 如下: select * from user where name = ...

  4. 文件下载功能django+js

    1. 功能叙述 前端web页面通过访问url+id的形式访问url lottery/draw/(?P<pk>(\d+))/download/ 后端代码通过orm查询pk相关数据 过滤出自己 ...

  5. day5作业购物商城+ATM

    模拟实现一个ATM + 购物商城程序 1.额度 15000或自定义 2.实现购物商城,买东西加入购物车,调用信用卡接口结账 3.可以提现,手续费5% 4.每月22号出账单,每月10号为还款日,过期未还 ...

  6. php判断是否是ajax提交 方法

    /** * 判断是否是AJAX提交 * @return bool */ function is_ajax() { if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) ...

  7. 将C++ IplImage 图像用C#读取

    如何将C++ IplImage 图像用C#读取  ? 将opencv 的C++程序做成 dll 动态链接库 用C#调用 当然这里需要安装emgucv  ,也可以自己实现这个类. 下面我把实现贴出来给大 ...

  8. Java 中常见数据类型的相互转换

    1.将String 转化成 long , 转化成 double String 转化成 long : long i = Long.parseLong(String s);    或 long i = L ...

  9. Looksery Cup 2015 F - Yura and Developers 单调栈+启发式合并

    F - Yura and Developers 第一次知道单调栈搞出来的区间也能启发式合并... 你把它想想成一个树的形式, 可以发现确实可以启发式合并. #include<bits/stdc+ ...

  10. NetworkX 使用(二)

    官方教程 博客:NetworkX %pylab inline import networkx as nx Populating the interactive namespace from numpy ...