[PAT grade B] 1095 decoding PAT admission certificate (25 points)
PAT admission number consists of 4 parts:
The first is the level, that is, # T # stands for the top level; A represents class A; B represents class B;The 2nd to 4th digits are the examination room number, ranging from 101 to 999;The 5th to 10th places are the examination date, and the format is year, month and day, accounting for 2 places in s ...
Added by twilitegxa on Wed, 16 Feb 2022 22:02:51 +0200
C + + preliminary core Programming Chapter 5: polymorphism and virtual function classes
C + + preliminary core Programming Chapter 5: polymorphism and virtual function classes
1. Summary of polymorphism
Polymorphism literally means multiple forms. Polymorphism is used when there is a hierarchy between classes and classes are associated through inheritance. C + + polymorphism means that when calling member functions, di ...
Added by rigi2 on Wed, 16 Feb 2022 12:22:30 +0200
C++ STL notes 13: STL common algorithms 3: common sorting algorithms;
Algorithm Introduction:
Sort / / sort the elements in the containerrandom_shuffle / / shuffle and randomly adjust the order of elements within the specified range.merge / / the container elements are merged and stored in another container.reverse / / reverses the elements of the specified range.
sort
Function Description:
Sort the ele ...
Added by tommy445 on Wed, 16 Feb 2022 06:48:33 +0200
Simple understanding of mvc design pattern
introduction
MVC design pattern is to separate the data model from the view, establish the relationship between the data model and the view through the controller, and automatically update the view when the data model changes. Among them, M-data model, V-view and C-controller. The following is a simple use of MVC design pattern.
Examples
The ...
Added by chetanrakesh on Wed, 16 Feb 2022 05:37:39 +0200
Creation, waiting, termination and separation of multithreads
1, Create a new thread
1. Header file: < pthread h> 2. Function: pthread_create(pthread_t *thread,const pyhread_attr_t *attr,void *(start_routine) (void ),void *arg);
namesignificancepthread_tEquivalent to unsigned integer length*threadID of the threadconst pyhread_attr_t *attrHalf of the properties of the thread are ignored. By default ...
Added by alanlee79 on Wed, 16 Feb 2022 03:33:44 +0200
100 examples of C language topic exercises - topic + topic analysis + source code (71-80)
[Title 71]
Title: write a function. When the input n is an even number, call the function to find 1 / 2 + 1 / 4 +... + 1/n. when the input n is an odd number, call the function 1 / 1 + 1 / 3 +... + 1/n (using pointer function). 1. Topic analysis: 2. The source code of the title is as follows:
#include "stdio.h"
#include "stdlib.h"
double even ...
Added by djKale on Tue, 15 Feb 2022 16:25:40 +0200
[ACWing algorithm basic course]: Chapter 5 - dynamic programming
Knapsack problem ★★★
(1) 0-1 knapsack problem (1 for each item)
Topic introduction sample input
4 5
1 2
2 4
3 4
4 5
output
8
[version 1] two dimensional state definition of 0-1 knapsack problem
f[i][j]: select only the first I items with total volume < = Max of J
State analysis
(1) When the current backpack capacity is insuf ...
Added by dast on Tue, 15 Feb 2022 14:15:19 +0200
"Function object" in C + +
Function object
Concept of function object
Concept: ○ classes that overload function call operators, and their objects are often called function objects; ○ when the function object uses overloaded (), its behavior is similar to function call, so it is usually called imitation function;Essence: ○ function object (imitation function) is a ...
Added by huckfinne on Tue, 15 Feb 2022 11:45:57 +0200
[CF559E]Gerald and Path
subject
Portal to CF
thinking
Generally speaking, we will sort intervals. Because the interval is essentially a two-dimensional partial order relationship, sorting according to the endpoint can make a dimension orderly, which is equivalent to dimension reduction.
In this question, the interval is not very fixed. But of the two possible rang ...
Added by $var on Tue, 15 Feb 2022 10:37:47 +0200
C + + Beginner Level -- classes and objects (Part 2)
[write before]
This article is a conclusion and supplement to classes and objects
1, On constructors
💦 Constructor body assignment
❓ Export initialization list ❔
class A
{
public:
A(int a = 0)
{
_a = a;
}
private:
int _a;
};
class B
{
private:
int _b = 1;
A _aa;
};
int main()
{
B b;
return 0;
}
📝 explain
For B, if ...
Added by The_Black_Knight on Tue, 15 Feb 2022 09:33:39 +0200