23-24C++ (46)–String string+ getline(cin, s)+a.length()+a.substr(x, y)+a.find(b)+a.rfind(b)

1. Characters and strings 1. Character: a single character enclosed in single quotes, Such as ‘a’, ‘_’, the corresponding data type is char. 2. String: any number of characters enclosed in double quotes, Such as “abc”, “a”, “”, ” “, the corresponding data type is const char [], which can be stored in the string […]

Find the longest repeating substring in a string—-Finding feature vector N method

Article directory topic Question analysis Implementation details Functions and their functions Use parameters and specific functions getmax_N(string P,int* N): Next(string P) main() Program running results Supplement (code explanation of feature vector N) Title Write an algorithm to return the longest repeating substring and its subscript position for a given string str. eg: str=”abcdacdac”, then the […]

Baoshi Document User Manual, and uses abstraction and reflection to create universal abstract classes to save development costs.

Document example 1024 is the best time to write a blog. Don’t say it, don’t say it, I suggest it become a legal holiday. The official website of Baoshi documents: Baoshi official website (@宝思TeamRemember to pay me for advertising) Steps to use the Boucherie certificate Use abstract classes to abstract the steps of obtaining fields, […]

Design pattern – 07.AbstractFactory abstract factory

Article directory Abstract FactoryAbstract Factory Motivation Schema definition Structure Summary of key points Abstract FactoryAbstract Factory The factory method can be regarded as a special case of abstract factory, also called factory method. Motivation In software systems, we are often faced with the creation of “A series of interdependent objects“; at the same time, due […]

Socket abstraction layer and sticky packets

Table of Contents 1. Socket abstraction layer 2. Socket programming based on TCP protocol 2.1 Server socket function 2.2 Client socket functions 2.3 Public-purpose socket functions 2.4 Lock-oriented socket approach 2.5 File-oriented socket functions Socket programming based on TCP protocol (simple) Server client 3. Socket programming + communication + communication cycle Server client 4. Socket […]

Abstract and easy java – mybaties

Pre-workhttp://t.csdnimg.cn/RVvn4 IDEA after completing the pre-production work should look like this Official introduction to mybaties The first step is to open the official website document of mybatieshttps://mybatis.net.cn/getting-started.html In this entry, we will construct a SQL factory from XML The first step is to create an XML file with a random name New → File → […]