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:

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

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

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

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
简单题:
代码:
  1. #include<iostream>
  2. #include<cstdio>
  3. using namespace std;
  4. int main()
  5. {
  6. int i,j,t,n,cnt;
  7. scanf("%d",&t);
  8. for(cnt=;cnt<=t;cnt++)
  9. {
  10. scanf("%d",&n);
  11. printf("Case #%d:\n",cnt);
  12. for(i=;i<;i++)
  13. {
  14. for(j=;j<;j++)
  15. {
  16. if(i==||i==)
  17. {
  18. if(j==||j==)
  19. printf("*");
  20. else
  21. printf("-");
  22. }
  23. else
  24. if(j==||j==)
  25. printf("|");
  26. else
  27. if(i<=-n/)
  28. printf(".");
  29. else
  30. printf("-");
  31. }
  32. puts("");
  33. }
  34. }
  35. return ;
  36. }

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之截屏(包括截取scrollview与listview的)

    public class ScreenShot { // 获取指定Activity的截屏,保存到png文件 public static Bitmap takeScreenShot(Activity a ...

  2. [PHP] Ubuntu 16.10 开启PHP错误提示

    两个步骤: 修改php.ini配置文件中的error_reporting 和 display_errors两地方内容: sudo vim /etc/php/7.0/apache2/php.ini er ...

  3. CVPR14 图像检索papers

    CVPR14年关于图像检索方面的papers,汇总成一个list,方便阅读. 图像检索 Triangulation embedding and democratic aggregation for i ...

  4. C语言:使用realloc函数对malloc或者calloc动态分配的内存大小进行扩展

    #include<stdio.h> #include<stdlib.h> #include<time.h> typedef struct { char name[3 ...

  5. OTL翻译(10) -- OTL的流缓冲池

    OTL的流缓冲池 一般来讲,流一般作为一个局部的变量被使用,当使用完毕后就立刻关闭,如果需要再次使用就需要再次的声明变量,如此循环.OTL流的缓冲池(内存池)是一个解决以往的流性能低下的一个机制.当流 ...

  6. Zabbix iostat 监控配置

    ## zabbix iostat 监控模板安装与配置 配置定时任务,用于生成iostat的统计数据 crontab -e * * * * * /usr/local/zabbix327/bin/iost ...

  7. GO语言基础条件、跳转、Array和Slice

    1. 判断语句if 1. 条件表达式没有括号(这点其他语言转过来的需要注意) 2. 支持一个初始化表达式(可以是并行方式,即:a, b, c := 1, 2, 3) 3. 左大括号必须和条件语句或 e ...

  8. 交叉编译git

    git依赖openssl.zlib. 首先编译openssl ./Configure linux-armv4 shared 修改Makefile,CC.RANLIB.MAKEDEPPROG为对应的交叉 ...

  9. [Big Data] Week4B (Basic)

    Question 1 Note: In this question, all columns will be written in their transposed form, as rows, to ...

  10. CSS半透明兼容写法

    filter: Alpha(opacity=10); -moz-opacity:0.1; opacity:0.1; 例如: background:#A5CD40; filter: Alpha(opac ...