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.
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
_ _ _
| _||_ |_
||_ _||_|
_ _ _
_| _||_| _|
|_ _| ||_
The digits showed by the digital clock are as follows: _ _ _ _ _ _ _ _ | _| _||_||_ |_ ||_||_|| | ||_ _| | _||_| ||_| _||_|
解题思路:
题意要求把相应的数字转换成时钟对应的图形输出。
首先预处理出0~9所有数字的图形,这里很多细节,比如每个数字占三个位置,如果是1的话,前面两个补空格什么的····具体详见代码···此处坑无限多
完整代码:
#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; /** Constant List .. **/ //{ 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 DoubleQ 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; } }
var app = getApp()Page({ data: { motto: 'Hello World', userInfo: {}, netWorkType: '', phoneType: '', phoneSystemType: '', }, //事件处理函数 bindViewTap: function() { wx.nav...
先查看防火墙是否开启了1521端口:firewall-cmd --permanent --query-port=1521/tcp打印结果如下:no表示没有开放1521端口,那么添加下该端口:firewall-cmd --permanent --add-port=1521/tcp打印结果如下:success重新加载防火墙策略:firewall-cmd --reload执行成功后,查看1521端口是否被开启:firewall-cmd --permanent --query-port=152
MySQL: 查看表注释: 用 SHOW TABLE STATUS [FROM db_name] 示例: SHOW TABLE STATUS ; --数据库下所有表注释 SHOW TABLE STATUS FROM d
3X05题目-[安洵杯 2019]easy_webimg参数两次base64解码一次hex解码得到555.png相反index.php经过反步骤得到TmprMlpUWTBOalUzT0RKbE56QTJPRGN3替换之后得到base64编码解码后得到php代码<?phperror_reporting(E_ALL || ~ E_NOTICE);header('content-type:text/html;charset=utf-8');$cmd = $_GET['cmd'];if (!i
文章目录一.RPM1.查询RPM包信息2.安装、卸载、升级RPM软件包3.解决软件包依赖关系方法4.维护RPM数据库二.YUM1.yum命令2.配置本地yum仓库一.RPM RPM软件包管理器Red-Hat package Manager1.由Red Hat公司提出, 被众多Linux发行版所采用2.建立统一的文件数据库3.详细记录软件包安装、卸载、升级等变化信息4.自动分析软件包依赖关系5.保持各应用程序在一个
GitHub项目地址:https://github.com/HarmoniaLeo/MFC-QQbot0x00 这是什么?欢迎使用本QQ机器人开发框架(如果有人会用的话)。本框架是主要使用MFC中的Windows API制作而成、利用Windows的消息机制以及一些系统级底层架构实现利用TIM客户端自动收发QQ消息的QQ机器人框架,用其制作的QQ机器人程序已在VS201...
1,使用截屏功能2,正在截屏的时候按下shit,然后看到一个#c92027(red/红色)3,按下字母C4,到需要颜色代码的地方Ctrl+V
三元运算a = 1b = 5c = a if a>b else bprint(c)构成变量 = 条件返回True的结果 if 条件 else 条件返回False的结果必须要有返回的结果必须要有if和else只能是简单的情况def func(a,b): return a if a>b else bc = func(3,5)...
在终端运行roscore,分别运行rosrun turtlesim turtle和rosrun turtlesim turtle_teleop_key,再输入rqt_graph,提示如下错误"dot" with args ['-Tdot', '/tmp/tmp145cvdav'] returned code: 1stdout, stderr:b''b'Format: "dot" not recognized. Use one of:\n'PluginHandlerDirect._resto.
这个标签会生成HTML form标签,同时为form内部所包含的标签提供一个绑定路径(binding path)。 它把命令对象(command object)存在PageContext中,这样form内部的标签 就可以使用这个对象了。标签库中的其他标签都声明在form标签的内部。 让我们假设有一个叫User的领域对象,它是一个JavaBean,有着诸如 firstName和lastName这
想要抓取今年运动会的成绩,然后网页内有选择日期的按钮,但是我用selenium点击,没反应,报错了,不知道是哪里有错误,请各位大神指教,代码如下:from selenium import webdriverbrowser = webdriver.Chrome()url = 'http://results.tianjin2017.gov.cn:81/#eyJNb2R1bGVzIjp7IkluZGV4...
编译Linux内核2.6.36一直以来,都是从事Linux用户空间的程序开发,对于Linux的了解仅限于基本Linux内核的经典书籍的阅读。由于目前从事的工作主要是TCP/IP 4层以上的处理,所以对内核的接触也不多。但近日空闲时间较多了,于是决定要好好研究研究Linux内核,主要集中在Linux内核的TCP/IP协议栈。...