摘要: 4.1 逻辑运算符 (1)&&逻辑与; (2)||逻辑或; (3)!逻辑非。 逻辑与、或的优先级别低于关系运算符,逻辑非高于算数运算符。建议使用括号来明确表达优先关系。 4.2 关系运算符 (1) a<b,小于; (2) a>b,大于; (3) a<=b,小于等于; (4) a>=b,大于等于; 若 阅读全文
posted @ 2022-01-18 09:22 许崇智 阅读(363) 评论(0) 推荐(0)
摘要: 3.1 模块的结构 3.1.1 模块的端口定义 module 模块名(口 1,口 2,口 3,口 4, ...); (1) 在引用时,严格按照模块定义的端口顺序来连接,不用标明原模块定义时规定的端口名。 (2) 在引用时用"."符号,标明原模块是定义时规定的端口名。于可以用端口名与被引用模块的端口相 阅读全文
posted @ 2022-01-13 21:21 许崇智 阅读(364) 评论(0) 推荐(0)
摘要: 恢复内容开始 报文格式 为了便于实现,我们简化地规定 DHCP 数据报文的格式如下: <发送主机> <接收主机> <报文类型> <IP 地址> <过期时刻> DHCP 数据报文的各个部分由空格分隔,其各个部分的定义如下: 发送主机:是发送报文的主机名,主机名是由小写字母、数字组成的字符串,唯一地表示 阅读全文
posted @ 2021-07-20 08:31 许崇智 阅读(260) 评论(0) 推荐(0)
摘要: 我今天在准备9月的CSP认证时碰见了一个问题:使用下面的代码输出字符串,然而发现变成了乱码。 printf("%s", H); 我以为是字符串的输入出了问题,但我尝试把字符串的每个字符的ASCII码打出后却发现是正确的,而且用std::cout可以正确输出。那一定就是输出环节出问题了。 我上网找了一 阅读全文
posted @ 2021-07-19 17:25 许崇智 阅读(535) 评论(0) 推荐(0)
摘要: l老夫最近数据结构学了Dijkstra算法,就想找一题来练习练习。 题目链接:https://www.luogu.com.cn/problem/P4779 这是一道Dijkstra算法的模板题,要求源点s到各店的最短路径长并输出。 起初,我以为这题很简单,不就是堆优化的Dijkstra算法吗?我就提 阅读全文
posted @ 2021-05-02 11:49 许崇智 阅读(111) 评论(0) 推荐(0)
摘要: 问题描述 我们把一个数称为有趣的,当且仅当: 1. 它的数字只包含0, 1, 2, 3,且这四个数字都出现过至少一次。 2. 所有的0都出现在所有的1之前,而所有的2都出现在所有的3之前。 3. 最高位数字不为0。 因此,符合我们定义的最小的有趣的数是2013。除此以外,4位的有趣的数还有两个:20 阅读全文
posted @ 2021-04-05 00:27 许崇智 阅读(108) 评论(0) 推荐(0)
摘要: Problem Statement There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The charact 阅读全文
posted @ 2021-04-03 19:19 许崇智 阅读(89) 评论(0) 推荐(0)
摘要: Problem Statement There are N boxes arranged in a row. Initially, the i-th box from the left contains ai candies. Snuke can perform the following oper 阅读全文
posted @ 2021-04-03 18:56 许崇智 阅读(75) 评论(0) 推荐(0)
摘要: Problem Statement You are given nonnegative integers a and b (a≤b), and a positive integer x. Among the integers between a and b, inclusive, how many 阅读全文
posted @ 2021-04-03 13:47 许崇智 阅读(136) 评论(0) 推荐(0)
摘要: Problem Statement You are given a string S consisting of digits between 1 and 9, inclusive. You can insert the letter + into some of the positions (po 阅读全文
posted @ 2021-04-02 23:40 许崇智 阅读(184) 评论(0) 推荐(0)