[C language] implementation of mine sweeping

catalogue 1, Clear up logic 2, Create file 3, Specific steps 1. Print menu 2. Create a two-dimensional array 3. Initialize the two-dimensional array and print the chessboard 4. Lay lightning   5. Mine investigation (including judgment of victory and defeat) 4, Complete code 5, To be improved 1, Clear up logic Let's take a ...

Posted by latvaustin on Wed, 24 Nov 2021 14:47:18 +0100

[C/C++ Server Development] Servers with rich functionality and can respond to multiple clients simultaneously

1. Preface Review of previous blogs: C/C++ Server/Background Development Learning Route Summary and Preparation What is a server? Server Classification and Building a Simple Server System [C/C++ Server Development] socket Network Programming Function Interface Details [C/C++ Server Development] Flexible application of socket network pr ...

Posted by gassaz on Tue, 23 Nov 2021 18:33:29 +0100

Summary of data structure knowledge points and common test examples

7, Figure Basic concept of graph 1. Graph: graph G is composed of two sets V and E, marked as G=(V,E), where V is a finite nonempty set of vertices and E is a finite set composed of ordered pairs of vertices in V. these ordered pairs are called edges or arcs 2. Undirected graph 3. Directed graph 4. Complete graph: if there are edges ...

Posted by ow-phil on Tue, 23 Nov 2021 15:52:24 +0100

Conditional and circular statements

Relational and logical operators Relational operator Logical operator &&And: when both operands are true, the result is true||Or: at least one of the two operands is true and the result is true!Non: the operand is true and the result is false Short circuit characteristics The value of the expression can be derived from the value o ...

Posted by Toneboy on Tue, 23 Nov 2021 09:14:25 +0100

swust oj problem solving #509 bedroom sweeping (nanny teaching)

catalogue subject Train of thought analysis code implementation subject Train of thought analysis According to the idea of this question, we might as well make a calendar for 2007 Then, according to the requirements of the topic, discharge the floor sweepers MonTueWedThuFriSatSunSeptember1(B)2(X)3(ALL)4(H)5(P)6(B)7(X)8(H)9(P)10(ALL)1 ...

Posted by spooke2k on Mon, 22 Nov 2021 22:45:08 +0100

An example understands and implements the hash table (refer to Redis Dictionary)

About hash tablesConcept of hash tableHash table, also known as hash table, is a data structure that directly accesses the memory storage location according to the key. Hash tables exist in many high-level languages. For example, in Python, there is a data structure called dict. The Chinese translation is a dictionary, which should be implemen ...

Posted by smordue on Mon, 22 Nov 2021 11:36:49 +0100

PAT class a 1010 Radix personal understanding

1010 Liu Shen It has been updated locally recently &Goodbye, firefly& 1010 Radix (25 branch) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number. Now for any pair of positive integers N 1 ​ and N 2 ​ , your task is to ...

Posted by phpScott on Sun, 21 Nov 2021 19:43:49 +0100

Introduction to C language Sanzi C language implementation (detailed version)

catalogue 1. Principle of Sanzi chess 2. Block code implementation 3. Summary 1. First of all, let's introduce the principle of Sanzi chess First, we need to have a chessboard. Initially, the chessboard is empty. We can change the space into a certain symbol by means of array. When any row or column or diagonal is the same symbol, on ...

Posted by just-j on Sun, 21 Nov 2021 09:36:02 +0100

Conceptual understanding of dynamic arrays and the creation and use of one-dimensional and two-dimensional arrays

First define the header file #include<stdio.h> #include<stdlib.h> #include<errno.h> #include<string.h> 1. Allocate memory space function malloc() Call form: (type specifier *) malloc (unsigned int size) Function: Allocate a continuous area with a length of 'size' bytes in the dynamic storage area of memory int *p ...

Posted by new7media on Sat, 20 Nov 2021 20:58:51 +0100

Fluctuation series, simple AC code, detailed explanation.

Wave series This problem really takes time to understand the details. Idea: As shown in the figure below, the first item of the sequence is x, the tolerance is set, set={a, - b}; From the first picture below, we can know that the number of set s is n*(n-1)/2 (formula: first term plus last term divided by 2) We let cnt=n*(n-1)/2 (that is, t ...

Posted by wha??? on Sat, 20 Nov 2021 18:51:25 +0100