• ## Landing algorithm | problem solving report of the 252nd weekly contest of leetcode weekly contest

Time：2021-11-22

Problem solving report of the 252nd weekly match of Li Kou No1. Triple divisor N is a triple divisor if and only if its divisor is 1, N and sqrt (n) class Solution { public boolean isThree(int n) { for (int i = 2; i * i <= n; i++) { if (n % i […]

• ## Online maximum common factor calculator

Time：2021-10-17

Online maximum common factor calculator Online maximum common factor calculator The tool can calculate the maximum common factor of 2 given numbers, which is calculated by pure client. The greatest common factor, also known as the greatest common divisor and the greatest common factor, refers to the largest of the common divisors of two or […]

• ## Go deep into the error handling mechanism of go and learn how to use it

Time：2021-9-1

Various errors will inevitably occur during program operation. In order to maintain high robustness of your program, exception and error handling need to be considered. Each programming language provides its own exception and error handling mechanism. Do you know in go? Next, let’s look at go’s exception error mechanism. Go error handling, multi return value […]

• ## operator

Time：2021-3-29

operator Arithmetic operator + – * /% (remainder) Here we focus on / and% operations **/Operation** It’s necessary to add that the decimal part is directly truncated instead of rounded. 3.1 is 3. 3.9 is also 3 %Operation The remainder operation requires that the operation object must be an integer. The result is the remainder […]

• ## Use native JS to judge prime numbers and find all prime numbers between 100 and 1000

Time：2021-3-25

Prime number:It is also called prime number, that is, a number greater than 1 and divisible only by 1 and itself Step idea:1. For traverses the loop to find other divisors2. If the setting satisfies the condition (the counter starts from 2, excluding itself), the output will be interrupted Demand 1: judge prime (quality) number […]

• ## C / C + + Programming Notes: C language error handling method! How to deal with program errors better?

Time：2020-12-28

C language is ignored some small things! C language basic course error handling. C language does not provide direct support for error handling, but as a system programming language, it allows you to access the underlying data in the form of return values. When an error occurs, most C or UNIX function calls return 1 […]

• ## Division without division

Time：2020-11-27

preface At the beginning of July, we challenged leetcode‘s question 29 (medium difficulty, which seems nothing to boast about). The problem requires that the function of integer division be realized without division, multiplication and modular operation. Since the divisor and divisor are integers, subtraction can be used to achieve division (what a naive idea). A […]

• ## On binary (2) – four operations

Time：2020-11-12

(Note:SegmentfaultThe mathematical formula in the article isBUGWhen previewing, it is good. When the article is sent out, it will show that there is a problem. If you have any problem when you read it, you can move on http://www.dubingxuan.com/article/8/ ) Preface In the last article about binary system (1), we spent a lot of space, […]

• ## 11 of 100 cases of C programming: finding prime number

Time：2020-5-29

Example 11 prime Problem description Prime number refers to a number that has no other divisor except 1 and itself as divisor. For example: 3, 5 and 7 are prime numbers. And 9 is not prime, because it has a divisor of 3. Write a program to find all prime numbers in a given interval. […]

• ## C × four operations and the selection of provinces and cities, and the selection of days and months

Time：2020-5-19

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); Button1. Text = “if syntax calculation”; Button2. Text = “switch syntax calculation”; Label2. Text = “province”; Label3. Text = “city”; } private void […]

• ## Go-for cycle

Time：2020-4-19

1、 First case (dead cycle) package main import “fmt” func main() { for{ fmt.Println(“fuck”) } } //For alone is a bit like while true in Python 2、 The second case (similar to the while condition) package main import “fmt” func main() { a :=1 for a<10{ fmt.Println(a) a++ } /* for ;a<10;{ fmt.Println(a) a++ } […]

• ## C programming (24): number system conversion

Time：2020-4-2

Example 24 number system conversion Title Description Please make a program to realize the data conversion between two different bases. Input format There are three lines in total. The first line is a positive integer, representing the base n (2 ≤ n ≤ 16) of the number to be converted. The second line is an […]