Solutions to group C/C++A questions of the 11th Blue Bridge Cup in 2020 (excluding the last two questions)
A house plate making
Title Description
Calculate the number of characters 2 from 1 to 2020.
thinking
The amount of data is very small, direct violence, and the number of 2 can be counted for each number.
code
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int ans = 0;
for (int i = 1; i <= 2020; i ...
Added by sbinkerd1 on Thu, 10 Feb 2022 13:55:01 +0200
An interesting example shows you the main difference between object-oriented programming and process oriented programming
Yesterday, a little friend asked me what is the main difference between object-oriented programming and process oriented programming. What are the advantages of object-oriented programming. For these two problems, we might as well give an example.
Scenario description
Xiaohao Shouzhuo bakery, who lives in Sichuan, is listed as follows:
Xiao ...
Added by lala on Thu, 10 Feb 2022 13:35:24 +0200
A brief introduction to EasyLogging + +
The open source address of easylogin + + project on Github: https://github.com/easylogging/easyloggingpp Functional features
·Height configurable
·Very fast
·Thread and type safety
·Cross platform
·Custom log module
·Conditional log and accidental log
·Performance tracking
·Detaile ...
Added by markmuir on Thu, 10 Feb 2022 12:48:10 +0200
C + +: copy on write technology and Simulation Implementation of string class
preface
Depth copy (depth assignment)
In previous articles C + +: Six default member functions and deep and shallow copies of the class , we have discussed the problem of deep and shallow copy in depth. If you don't know the of deep and shallow copy, you can take a look at this article first.
Here we directly give the definition of dee ...
Added by philwong on Thu, 10 Feb 2022 12:12:59 +0200
C + + implements the related algorithms of data structure and algorithm -- stack and queue
Implementation of stack and queue related algorithms
In the process of learning data structure and algorithm, in order to better understand the implementation of the algorithm, this paper implements the algorithms of stack and queue in the course. This article only provides algorithm code reference. For detailed explanation of relevant algorit ...
Added by czambran on Thu, 10 Feb 2022 07:41:56 +0200
3 - Generic Programming Style
Standard Template Library: Standard Template Library(
STL)
Sequential container: vector, list. It is mainly used for iterative operations.Associated container: map, set. It is mainly used to quickly find the element value in the container.
Generic algorithms provide many operations that can act on container classes and array types. T ...
Added by the182guy on Thu, 10 Feb 2022 06:13:08 +0200
type_traits-integer_sequence Resolution (add variable parameters in inheritance mode)
preface
Test what you have learned before. Learn how to use templates from the source code.
Definition and use
integer_sequence: judge whether it is an integer type. If it is not, the compilation fails (using static assertion). If it is, save its own type and the incoming integer type, as well as the length of variable parameters. inde ...
Added by kitchin on Thu, 10 Feb 2022 02:44:43 +0200
[data structure and algorithm] basic oj exercise of binary tree
1. Single valued binary tree
– oj link Solution:
1. Judge whether the value of the left child of the root is the same as the root node. 2. Judge whether the value of the right child of the root is the same as the root node. 3. Judge whether the binary tree with the left child of the root as the root is a single valued binary tre ...
Added by liquid79 on Thu, 10 Feb 2022 01:07:25 +0200
[C + +] 5-1.5 immutable objects and classes
Immutable object
Immutable object: after an object is created, its content cannot be changed, There is one exception: assign a value to this object in the form of an assignment operator (in the form of member copy), That is, copy other objects to the current object. In this case, its content can be changed!
Immutable objects have many adv ...
Added by rabab.orthalis on Wed, 09 Feb 2022 22:54:31 +0200
Audio and video development video and video frames: RTMP streaming of ffmpeg
Recommended Video: RTSP/RTMP streaming analysis streaming architecture analysis / streaming cache queue design / FFmpeg function blocking analysis https://www.bilibili.com/video/BV1ky4y177Jh
1. I ntroduction to streaming
When I first heard "streaming", I thought to myself, "what is this high-end thing?", Under the pressure ...
Added by abdbuet on Wed, 09 Feb 2022 18:53:54 +0200