NBUT 1219 Time 2010辽宁省赛
2024-08-22 20:29:42
Time limit 1000 ms
Memory limit 131072 kB
Digital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “).now given the current time, please tell us how can it be expressed by the digital clock.
Input
There are several test cases.
Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
Output
For each test case, output the time expressed by the digital clock such as Sample Output.
Sample Input
1 2 5 6
2 3 4 2
Sample Output
_ _ _
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
Hint
The digits showed by the digital clock are as follows:
_ _ _ _ _ _ _ _
| _| _||_||_ |_ ||_||_|| |
||_ _| | _||_| ||_| _||_| 签到题,理清楚就好,代码如下
#include <iostream>
#include<stdio.h>
using namespace std;
int num[];
char s1[][]={
{' ','_',' '},{' ',' ',' '},{' ','_',' '},{' ','_',' '},
{' ',' ',' '},{' ','_',' '},{' ','_',' '},{' ','_',' '},
{' ','_',' '},{' ','_',' '}
};
char s2[][]={
{'|',' ','|'},{' ',' ','|'},{' ','_','|'},{' ','_','|'},
{'|','_','|'},{'|','_',' '},{'|','_',' '},{' ',' ','|'},
{'|','_','|'},{'|','_','|'}
};
char s3[][]={
{'|','_','|'},{' ',' ','|'},{'|','_',' '},{' ','_','|'},
{' ',' ','|'},{' ','_','|'},{'|','_','|'},{' ',' ','|'},
{'|','_','|'},{' ','_','|'}
};
int main()
{
while(~scanf("%d",&num[]))
{
for(int i=;i<;i++)scanf("%d",&num[i]); for(int i=;i<;i++)
for(int j=;j<;j++)
{ printf("%c",s1[num[i]][j]);
}
printf("\n");
for(int i=;i<;i++)
for(int j=;j<;j++)
{
printf("%c",s2[num[i]][j]);
}
printf("\n");
for(int i=;i<;i++)
for(int j=;j<;j++)
{
printf("%c",s3[num[i]][j]);
}
printf("\n"); } return ;
}
最新文章
- jquery对标签属性操作
- jquery 数组和字典
- 怎么跳出MySQL的10个大坑
- ARCGIS二维三维放大缩小
- LINUX HA:Pacemaker + Corosync初配成功
- 爱加密亮相第十八届软博会,移动App安全引关注
- es6 Module语法
- C#中扩展方法的使用
- LoadRunner服务水平协议SLA
- ugui 灰度shader mask冲突解决 转。。。
- tensorflow入门指南
- 安装Vue Devtools
- 在ASP.NET MVC中以post方式传递数组参数的示例【转】
- Centos6.4下安装protobuf-c问题及解决办法
- 构造用于1个方法在多线程环境下重复多次执行测试的通用方法 C#
- Oracle数据类型clob和blob
- K8S中RC与Deployment的区别
- PIE SDK矢量点生成等值线、面
- 【Leetcode】【Medium】Multiply Strings
- 如何在不重启或重新格式化hadoop集群的情况下删除集群节点
热门文章
- springmvc+druid+dataSource配置的两种方式
- hdu 1796 How many integers can you find 容斥定理
- Ubuntu14.04 libboost_program_options.so.1.54.0: cannot open shared object file: No such file or directory
- OpenGL遮挡查询
- android适配各种分辨率的问题
- Longest Repeating Character Replacement
- SqlServer使用表值函数汇总
- 在centos7上安装gcc、node.js(源码下载)
- mac 安装phpunit
- 最齐全的Android studio 快捷键(亲测可用)