Maximum common divisor and minimum common multiple (c language, detailed)
1, Least common multiple (LCM)
Minimum common multiple = the product of the two input numbers is divided by their maximum common divisor (a*b / maximum common divisor). The key is to find the maximum common divisor;
2, Maximum common divisor (GCD)
1. Rolling division / Euclidean algorithm
Definition: first divide the larger number by the sm ...
Added by VapiD on Tue, 25 Jan 2022 07:49:03 +0200
Random number that generates normal distribution of any mean and variance based on C language. The generated random number can be based on any range or specified range
1. Purpose
Due to the needs of the project, a series of random numbers need to be generated. The random numbers are not uniformly distributed, but based on normal distribution, and the random numbers need to be within the specified interval.
2. Result display
In my project, I want to generate a random number with normal distribution, r ...
Added by fallen_angel21 on Tue, 25 Jan 2022 06:30:26 +0200
Introduction to C language lesson 7: structure
Lesson 7: structure
catalogue
Lesson 7: structure
1.1 declaration of structure
1.2. Access of structure members
1.3. Structure transmission parameters
1.4. Compound literal and structure in C99
1.5. Scalable array members in C99
Anonymous structure in 1.6 · C11
1.1 declaration of structure
Before explaining the structure, let' ...
Added by elToro on Tue, 25 Jan 2022 06:19:14 +0200
PIPIOJ 1039: repeat subsequence problem
1039: repeat subsequence problem
Title Description
PIPI has two strings a and B. please find out how many times the string a is repeated at least to make B a subsequence of A.
We call x a subsequence of Y if and only if several characters can be deleted from Y to get X.
For example, for A = "abb" and B="bbaa", A repeats ...
Added by phpbeginner0120 on Tue, 25 Jan 2022 03:36:59 +0200
Simple implementation of Sanzi chess with C language
I How to design
First of all, we can use functions to divide the implementation of Sanzi chess into different modules. We can think about it. For a game, there must first be a directory for players to choose whether to play or not, that is, the menu interface; Secondly, we have to have a chessboard. The next step is for the player to fall, and ...
Added by smixcer on Tue, 25 Jan 2022 03:11:28 +0200
Love and hate between callback function and qsort function
catalogue
1, Simple bubble sort
1.1 meaning of bubble sorting
1.2 bubble sorting two steps
1.3 complete code
2, qsort function implementation
2.1qsort function analysis
2.2qsort function to sort structure types
2.3 implementation of qsort by user-defined functions
Third, callback function
1, Simple bubble sort
1.1 meaning of bubbl ...
Added by FFFF on Mon, 24 Jan 2022 19:45:11 +0200
C language keyword (custom type)
preface
Today, I'm mainly talking about the knowledge of structures, enumerations and federations. It may be boring, but it's very important. I'll try to be more detailed
Structure keyword struct
struct is the keyword for declaring the structure type. We often use it in learning linked list, so I divide it into two levels
prim ...
Added by hongco on Mon, 24 Jan 2022 18:59:59 +0200
C linked list Summary - single linked list
Tip: after the article is written, the directory can be generated automatically. Please refer to the help document on the right for how to generate it
Article catalog
preface1, What is pandas?2, Use steps
1. Import and storage2. Read in datasummary
preface
Recently, I learned about the single linked list and did some exercises ...
Added by johanafm on Mon, 24 Jan 2022 14:50:22 +0200
Interprocess communication - Pipeline
Introduction to interprocess communication
Purpose of interprocess communication
Data transfer: one process needs to send its data to another processResource sharing: multiple processes share the same resources.Notification event: a process needs to send a message to another process or group of processes to notify it (them) of an event ...
Added by Petsmacker on Mon, 24 Jan 2022 14:44:36 +0200
Codeforces Round #767 (Div. 2) A~D
A Download More RAM
Topic meaning: upgrade memory. Given the initial memory, use the given n software to upgrade memory. The ith software startup requires at least a memory, and b memory can be permanently added to find the maximum memory Idea: just sort greedy
#include<bits/stdc++.h>
#define ios ios::sync_with_stdio(false),cin.tie(0),c ...
Added by mistercash60000 on Mon, 24 Jan 2022 07:54:11 +0200