模拟时钟
来源:互联网 发布:sql 删除表外键约束 编辑:程序博客网 时间:2024/05/29 08:35
1003: Time
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 113 Solved: 67
[Submit][Status][Web Board] [Edit] [TestData]
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.
Sample Input
1 2 5 62 3 4 2
Sample Output
_ _ _ | _||_ |_ ||_ _||_| _ _ _ _| _||_| _||_ _| ||_
HINT
The digits showed by the digital clock are as follows: _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_|
Source
辽宁省赛2010
模拟题:
#include <functional>#include <algorithm>#include <iostream>#include <fstream>#include <sstream>#include <iomanip>#include <numeric>#include <cstring>#include <climits>#include <cassert>#include <complex>#include <cstdio>#include <string>#include <vector>#include <bitset>#include <queue>#include <stack>#include <cmath>#include <ctime>#include <list>#include <set>#include <map>using namespace std;#pragma comment(linker, "/STACK:102400000,102400000")typedef long long LL;typedef double DB;typedef unsigned uint;typedef unsigned long long uLL;const int MOD = int(1e9)+7;const int INF = 0x3f3f3f3f;const LL INFF = 0x3f3f3f3f3f3f3f3fLL;const DB EPS = 1e-9;const DB OO = 1e20;const DB PI = acos(-1.0); //M_PI;const int maxn = 1001;int a[4];string s1[maxn] = { " _ " , " " , " _ " , " _ " , " " , " _ " , " _ " , " _ " , " _ " , " _ " };string s2[maxn] = { "| |" , " |" , " _|" , " _|" , "|_|" , "|_ " , "|_ " , " |" , "|_|" , "|_|" };string s3[maxn] = { "|_|" , " |" , "|_ " , " _|" , " |" , " _|" , "|_|" , " |" , "|_|" , " _|" };int main(){ #ifdef xxz freopen("in.txt","r",stdin); #endif while(cin >> a[0] >>a[1] >> a[2] >> a[3]) { for(int i = 0 ; i < 4 ; i ++) { cout << s1[a[i]]; } cout << endl; for(int i = 0 ; i < 4 ; i ++) { cout << s2[a[i]]; } cout << endl; for(int i = 0 ; i < 4 ; i ++) { cout << s3[a[i]]; } cout << endl; }}
0 0
- 模拟时钟
- 模拟时钟
- 模拟时钟
- 模拟时钟
- 模拟时钟
- 模拟时钟
- 模拟时钟,让时钟走动
- js模拟时钟代码
- 模拟小时钟源代码
- c语言模拟时钟
- Java模拟时钟
- Java模拟时钟
- css3模拟时钟
- javascript 案例:模拟时钟
- QT模拟时钟程序
- 模拟时钟的实现
- 控制台模拟电子时钟
- 模拟时钟例程
- jsp的一些基础语法知识
- POJ 2000 Gold Coins(简单模拟)
- (30 hackdays day 19) CARA - EQ不足CARA补
- Android获取服务器后台数据
- java.util.concurrent.Future 类基础
- 模拟时钟
- session和cookie
- Android中通过Intent调用其他应用的方法(转)
- Android 应用出错 error: Error retrieving parent for item: No resource found that matches the的第二种情况
- CentOS 6.x 系统安装+网卡驱动安装(Realtek PCIe GBE Family Controller for linux)
- 几个VS编译器(cl.exe)命令行编译的例子
- Android笔记七.ListView+Adapter
- 理解OAuth 2.0
- java调用.net服务例子