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:

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

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
简单题:
代码:
 #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int i,j,t,n,cnt;
scanf("%d",&t);
for(cnt=;cnt<=t;cnt++)
{
scanf("%d",&n);
printf("Case #%d:\n",cnt);
for(i=;i<;i++)
{
for(j=;j<;j++)
{
if(i==||i==)
{
if(j==||j==)
printf("*");
else
printf("-");
}
else
if(j==||j==)
printf("|");
else
if(i<=-n/)
printf(".");
else
printf("-");
}
puts("");
}
}
return ;
}

最新文章

  1. Ubuntu16.04 安装配置Caffe
  2. 在ScrollView下加入的组件,不能自动扩展到屏幕高度
  3. 基于eBox的LTC1446驱动
  4. 如何实现Qlikview的增量数据加载
  5. UWP开发入门(十四)—— UserControl中Adaptive UI的小技巧
  6. CentOs6.5中安装和配置vsftp
  7. CSharp使用log4net记录日志
  8. android项目中如何加载已有so库 &lt;转&gt;
  9. 第一章TP-Link 703N刷OpenWrt
  10. svn 清空
  11. ASP.NET MVC上传文件的几种方法
  12. Linux 程序设计的一些优化措施
  13. Arduino 串口篇 Arduino发送二进制 send binary via RS232-to-USB to PC
  14. 【Android Developers Training】 31. 序言:共享简单数据
  15. 网页设计——6.html其他标签
  16. Linux - gcc 的简易用法 (编译、参数与链结)
  17. Paint.FontMetrics
  18. pyinstaller
  19. java使用Iterator 迭代器
  20. Sqrt Bo (水题)

热门文章

  1. opencv编译Python接口
  2. C语言:字符串输出流输出文件中的数据。
  3. otl中遇到的一些字符数组长度问题
  4. android.net.Uri 简介 API
  5. Android之属性动画(二)
  6. python 斐波拉契数列数列
  7. IIS-设置session时间
  8. PCL源码剖析之MarchingCubes算法
  9. 解决bootstrap和jquey中的.button扩展冲突的问题。
  10. Web前端开发资源集锦