1258: Time

时间限制: 1 Sec  内存限制: 128 MB
提交: 16  解决: 11
[提交][状态][讨论版]

题目描述

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.

样例输入

1 2 5 6
2 3 4 2

样例输出

    _  _  _
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
#include<iostream>
#include<cstring>
#include<cstdio> using namespace std; int main(){
int a[];
while(scanf("%d %d %d %d", &a[], &a[], &a[], &a[]) == ){
for(int i = ; i <= ; i++){
for(int j = ; j < && i == ; j++){
if(a[j] == || a[j] == ) printf(" ");
else printf(" _ ");
}
for(int j = ; j < && i == ; j++){
switch(a[j]){
case : case :
case : printf("|_|"); break;
case :
case : printf(" |"); break;
case :
case : printf(" _|"); break;
case :
case : printf("|_ "); break;
case : printf("| |"); break;
}
}
for(int j = ; j < && i == ; j++){
switch(a[j]){
case : case :
case : printf(" |"); break;
case : printf("|_ "); break;
case : case :
case : printf(" _|"); break;
case : case :
case : printf("|_|"); break;
}
}
printf("\n");
}
}
}

HNUSTOJ-1258 Time的更多相关文章

  1. hdu 1258 Sum It Up(dfs+去重)

    题目大意: 给你一个总和(total)和一列(list)整数,共n个整数,要求用这些整数相加,使相加的结果等于total,找出所有不相同的拼凑方法. 例如,total = 4,n = 6,list = ...

  2. POJ 1258

    http://poj.org/problem?id=1258 今天晚上随便找了两道题,没想到两道都是我第一次碰到的类型———最小生成树.我以前并没有见过,也不知道怎么做,然后就看书,思路很容易理解 但 ...

  3. hdoj - 1258 Sum It Up && hdoj - 1016 Prime Ring Problem (简单dfs)

    http://acm.hdu.edu.cn/showproblem.php?pid=1258 关键点就是一次递归里面一样的数字只能选一次. #include <cstdio> #inclu ...

  4. poj - 1258 Agri-Net (最小生成树)

    http://poj.org/problem?id=1258 FJ为了竞选市长,承诺为这个地区的所有农场联网,为了减少花费,希望所需光纤越少越好,给定每两个农场的花费,求出最小花费. 最小生成树. # ...

  5. [TimusACM][1258]程序员撞墙的问题

    (本文是从我的旧博客迁移过来的) 问题地址:http://acm.timus.ru/problem.aspx?space=1&num=1258 前几日在博客园看到这种在线测试的时候,有一种相见 ...

  6. 最小生成树 10.1.5.253 1505 poj 1258 http://poj.org/problem?id=1258

    #include <iostream>// poj 1258 10.1.5.253 1505 using namespace std; #define N 105 // 顶点的最大个数 ( ...

  7. 【hihocoder 1258 Osu! Master】

    2015北京区域赛现场赛签到题. 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hih ...

  8. hdoj 1258 SUM IT UP

    程序的思想是:输入数据是,先使用快排对其从大到小进行排序,然后记录相同数据的个数,比如4 3 3 2 2 1 1,最后的数据变成4 3 2 1 ,并且同时数据的个数f[]变成1 2 2 2 然后就是遍 ...

  9. lightOJ 1258 Making Huge Palindromes(KMP)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1258 就是求逆串和原串的匹配长度 答案就是原串长度的2倍减去匹配长度即可 第一次我将原 ...

  10. 51NOD 1258 序列求和 V4 [任意模数fft 多项式求逆元 伯努利数]

    1258 序列求和 V4 题意:求\(S_m(n) = \sum_{i=1}^n i^m \mod 10^9+7\),多组数据,\(T \le 500, n \le 10^{18}, k \le 50 ...

随机推荐

  1. js支持中文的hex编码 bin2hex (utf-8)

    背景: 最近对接接口的时候需要将请求参数转为16进制,因此研究了下这个bin2hex.在js中转16进制 使用的是: str.charCodeAt(i).toString(16); 在遇到中文的时候编 ...

  2. java+web+超大文件上传

    javaweb上传文件 上传文件的jsp中的部分 上传文件同样可以使用form表单向后端发请求,也可以使用 ajax向后端发请求 1.通过form表单向后端发送请求 <form id=" ...

  3. selenium,控制滚动条

    今天写selenium用例的时候,遇见奇葩的问题,FF下是没有错误的,但是在chrome和ie下就会有问题,后来发现是 操作中点击一个按钮,在页面不可见,就会导致异常,解决方法如下: element ...

  4. sweetalert2 全面替代 alert ,从 sweetalert2 弹出 text 到 弹出 Dom 以及模态框和取消 sweetalert2 的 OK 按钮

    1. 简易基本版 sweetalert 涵盖日常基本的弹出及对话框 2. 升级版本 sweetalert2 满足常见开发工作中的各种要求 3 取消 OK 按钮, 只需要设置 showConfirmBu ...

  5. Oracle-执行./runInstaller报错,弹不出图形界面

    [root@Apexmic Packages]# xhost + 无论是root用户还是oracle用户均执行了xhost + 但还是报以下错误 [oracle@Apexmic database]$ ...

  6. 管理es索引-使用 Xput创建索引

    curl是利用URL语法在命令行方式下工作的开源文件传输工具,使用curl可以简单实现常见的get/post请求.简单的认为是可以在命令行下面访问url的一个工具.在centos的默认库里面是有cur ...

  7. CDH安装时,部分节点不受管控

    解决方案: /opt/cm-5.12.0/etc/init.d/cloudera-scm-agent stop cd /opt/cm-5.12.0/lib/cloudera-scm-agent/ rm ...

  8. JavaWEB开发03——JS

    今日任务 使用JS完成页面定时弹出广告 使用JS完成表单的校验 使用JS完成表格的隔行换色 使用JS完成复选框的全选效果 使用JS完成省市的联动效果 JS控制下拉列表左右选择 教学导航 掌握JS中的B ...

  9. XDebug安装配置教程

    笔者的开发环境如下:Windows8.1+Apache+PhpStorm+XDebug+Firefox(XDebug helper 1.4.3插件). 转载http://www.jb51.net/ar ...

  10. .Net Core-3.0-新闻:宣告推出.NET Core 3.0 Preview 7

    ylbtech-.Net Core-3.0-新闻:宣告推出.NET Core 3.0 Preview 7  1.返回顶部 1. 今天,我们宣布推出.NET Core 3.0 Preview 7.我们已 ...