Problem: Time(一道水却有意思的题
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.
There are several test cases.
Each case contains 4 integers in a line, separated by space.
Proceed to the end of file.
For each test case, output the time expressed by the digital clock such as Sample Output.
2 3 4 2
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
这道题很明显就是判断输入并输出,虽然简单,不过分类的时候的确令人头痛
代码:
#include <stdio.h>
int main()
{
int c[];
while(scanf("%d",&c[])!=EOF)
{
for(int i=;i<=;i++)
scanf("%d",&c[i]); for(int i=;i<=;i++)
if(c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==||c[i]==)
printf(" _ ");
else if(c[i]==||c[i]==)
printf(" ");
printf("\n"); for(int i=;i<=;i++)
if(c[i]==||c[i]==)
printf(" |");
else if(c[i]==||c[i]==)
printf(" _|");
else if(c[i]==||c[i]==||c[i]==)
printf("|_|");
else if(c[i]==||c[i]==)
printf("|_ ");
else if(c[i]==)
printf("| |");
printf("\n"); for(int i=;i<=;i++)
if(c[i]==||c[i]==||c[i]==)
printf(" |");
else if(c[i]==)
printf("|_ ");
else if(c[i]==||c[i]==||c[i]==)
printf(" _|");
else if(c[i]==||c[i]==||c[i]==)
printf("|_|");
printf("\n");
} return ;
}
Problem: Time(一道水却有意思的题的更多相关文章
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- ny525 一道水题
一道水题时间限制:1000 ms | 内存限制:65535 KB 难度:2描述 今天LZQ在玩一种小游戏,但是这游戏数有一点点的大,他一个人玩的累,想多拉一些人进来帮帮他,你能写一个程序帮帮他吗? ...
- NYOJ-525一道水题思路及详解
一道水题 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 今天LZQ在玩一种小游戏,但是这游戏数有一点点的大,他一个人玩的累,想多拉一些人进来帮帮他,你能写一个程序帮帮他 ...
- LibreOJ #6165. 一道水题
二次联通门 : LibreOJ #6165. 一道水题 /* LibreOJ #6165. 一道水题 欧拉线性筛 其实题意就是求区间[1, n]所有数的最小公倍数 那么答案就是所有质因子最大幂次的乘积 ...
- CODE FESTIVAL 2017 qual B B - Problem Set【水题,stl map】
CODE FESTIVAL 2017 qual B B - Problem Set 确实水题,但当时没想到map,用sort后逐个比较解决的,感觉麻烦些,虽然效率高很多.map确实好写点. 用map: ...
- 【图灵杯 F】一道简单的递推题(矩阵快速幂,乘法模板)
Description 存在如下递推式: F(n+1)=A1*F(n)+A2*F(n-1)+-+An*F(1) F(n+2)=A1*F(n+1)+A2*F(n)+-+An*F(2) - 求第K项的值对 ...
- 一道很经典的 BFS 题
一道很经典的 BFS 题 想认真的写篇题解. 题目来自:https://www.luogu.org/problemnew/show/P1126 题目描述 机器人移动学会(RMI)现在正尝试用机器人搬运 ...
- Problem E: 穷游中国在统题 优先队列 + 模拟
http://www.gdutcode.sinaapp.com/problem.php?cid=1049&pid=4 Problem E: 穷游中国在统题 Description Travel ...
- 一道有趣的for循环题
一道有趣的for循环题 今天在复习js基础知识时发现了一个for循环的题,第一眼看到直接懵逼了,没想到for循环竟然还可以这样玩?涨姿势了. 题目是这样的 for(i=0, j=0; i<10, ...
随机推荐
- mybatis 一对一关联 association 返回空值
mybatis 一对一关联 association 返回空值 最近学习spring mvc + mybatis开发,看的书是<Spring MVC+Mybatis开发 从入门到精通>,在学 ...
- jquery 点击显示更多
点击显示更多 html <div class="servicepicture banxin"> <div class="imgcontent" ...
- vue keep-alive 取消某个页面缓存问题
keep-alive keep-alive是Vue提供的一个抽象组件,用来对组件进行缓存,从而节省性能,由于是一个抽象组件,所以在v页面渲染完毕后不会被渲染成一个DOM元素 <keep-aliv ...
- github隐藏文件&删除文件
一.隐藏文件不提交至github 例如:需隐藏node_modules文件夹 1.找到.gitignore文件,一般这个是隐藏文件,需要显示隐藏文件 2.编辑.gitignore文件,加入下面这一句话 ...
- Shell 脚本练习
[第一个] #!/bin/bash#每个用户的总充值和消费以及剩余. cat yuanbao.txt |grep -v 2016 |awk '{print $3}' |awk '!a[$0]++' & ...
- oracle中delete、truncate、drop的区别 (转载)
一.delete 1.delete是DML,执行delete操作时,每次从表中删除一行,并且同时将该行的的删除操作记录在redo和undo表空间中以便进行回滚(rollback)和重做操作,但要注意表 ...
- gcc/g++编译器的安装与说明
gcc/g++编译器的安装与说明 1.gcc/g++编译器的安装 gcc yum install gcc g++ yum install gcc-c++ 2.gcc/g++的作用 将c/c++源代码编 ...
- windows cmd 查找/关闭端口
1.首先查找端口,会显示出所有的端口,比如说要找到端口为“8888”的PID netstat -ano 2.还可以精确查找 netstat -aon|findstr " 3.关闭对应的端口 ...
- docker 镜像运行问题
- 在Linux CentOS6系统中安装开源CMS程序OpenCart的教程
OpenCart是一个开放源码的店面,旨在为您提供灵活和细粒度的在线店面管理.在开始之前,您应该已经在您的Linode上设置了一个LAMP堆栈.您还应该设置主机名. PHP设置 为了使用OpenCar ...