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. 6424. 【NOIP2019模拟2019.11.13】我的订书机之恋

    题目描述 Description Input Output Sample Input 见下载 Sample Output 见下载 Data Constraint 题解 lj题卡线段树 求出每个右端点往 ...

  2. Mybatis mysql 一个搜索框多个字段模糊查询 几种方法

    第一种 or 根据搜索框给定的关键词,模糊搜索用户名和账号都匹配的用户集合 <select id="list" parameterType="com.user.Us ...

  3. html caption标签 语法

    html caption标签 语法 caption是什么标签? 作用:定义表格标题. 说明:caption 标签必须紧随 table 标签之后.您只能对每个表格定义一个标题.通常这个标题会被居中于表格 ...

  4. new 做了什么

    var a=function(){ this.che1 = function () { console.log(1) } this.che2 = function () { console.log(2 ...

  5. HTML 和 CSS 画三角形和画多边行基本原理及实践

    基本 HTML 标签 <div class = 'test'></div> 基本 CSS 代码 .test { width: 100px; height: 100px; bac ...

  6. [CSP-S模拟测试]:最大异或和(数学)

    题目传送门(内部题81) 输入格式 第一行一个整数$T(T\leqslant 20)$,表示测试数据组数 接下来$T$组,对于每一组,第一行一个整数$n$ 第二行有$n$个整数,为$w_1,w_2.. ...

  7. always_populate_raw_post_data

    Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a futu ...

  8. C语言指令数组名和数组名取地址

    以下C语言指令:int a[5] = {1, 3, 5, 7, 9}; int *p = (int *)(&a + 1); printf("%d, %d", *(a + 1 ...

  9. Object 的 property descriptor

    property descriptor 属性描述符: o = { get foo() { return 17; } }; d = Object.getOwnPropertyDescriptor(o, ...

  10. Chrome 浏览器添加跨域支持

    开发前端本地项目时,涉及到与后端服务器的通信联调,在使用 ajax 时由于浏览器的安全策略不允许跨域.一种方式是本地搭建转发服务器,今天又 GET 到一种更直接的方式,在 Chrome 浏览器开启时添 ...