Time(java模拟法)
来源:互联网 发布:网络平台运行 编辑:程序博客网 时间:2024/05/21 09:49
Time
Time Limit: 1000MS Memory Limit: 65536KB
Submit Statistic
Problem Description
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.
Output
For each test case, output the time expressed by the digital clock such as Sample Output.
Example Input
1 2 5 62 3 4 2
Example Output
_ _ _ | _||_ |_ ||_ _||_| _ _ _ _| _||_| _||_ _| ||_
Hint
Author
import java.util.*;import java.math.*; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); String top[]=new String[]{" _ "," "," _ "," _ "," "," _ "," _ "," _ "," _ "," _ "}; String mid[]= new String[]{"| |"," |"," _|"," _|","|_|","|_ ","|_ "," |","|_|","|_|"}; String bot[]= new String[]{"|_|"," |","|_ "," _|"," |"," _|","|_|"," |","|_|"," _|"}; while(input.hasNextInt()) { int a = input.nextInt(); int b = input.nextInt(); int c = input.nextInt(); int d = input.nextInt(); System.out.println(top[a]+""+top[b]+""+top[c]+""+top[d]); System.out.println(mid[a]+""+mid[b]+""+mid[c]+""+mid[d]); System.out.println(bot[a]+""+bot[b]+""+bot[c]+""+bot[d]); } } }
0 0
- Time(java模拟法)
- ZOJ - 3875 Lunch Time (模拟)水
- Codeforces868B Race Against Time (模拟)
- Educational Codeforces Round 7-B. The Time(模拟)
- CodeFroces Round 438 B.Race Against Time(模拟)
- Codeforces Round #438 B Race Against Time(模拟)
- java--time
- JAVA [Time]
- LA 4665 Favorite Time 模拟
- nyoj 288 Time【数组模拟】
- ZOJ 3875-Lunch Time【模拟】
- L Daylight Saving Time(模拟)
- java time转为UNIX TIME
- c++模拟MFC中运行时类型识别(RTTI)(Run-Time Type Identification)
- HDU - 4001 To Miss Our Children Time (模拟)可以放多高的砖
- (hdu6077)2017杭电多校联赛第四场-Time To Get Up 模拟题
- 2017杭电多校第四场 1011 Time To Get Up(模拟)HDU 6077
- Codeforces Round #438 (Div. 1 + Div. 2 combined) B. Race Against Time(模拟)
- 如何申请试用MaxCompute 2.0
- 贪心算法--1基础
- 二、Junit4 注解
- drop&drug 学习:拼图demo
- C语言中的基本类型
- Time(java模拟法)
- FineReport中如何用JavaScript解决控件值刷新不及时
- MaxCompute应用限制整理
- 用Python做测试——测试人员需要掌握的Python基础(二)
- 工作内容
- Hadoop第一天
- 一个简单例子理解C语言指针
- windows消息队列
- python中带星号/一个星号/两个星号的参数