Tag:integer

  • Redis design and implementation 9: a collection of five data types

    Time:2021-4-15

    There are two encoding methods for set objectsintsetandhashtable Code 1: intset The structure of intset Set of integersintsetIt is one of the implementations of the collection bottom layer. As you can see from the name, it is a collection type specially provided for integers.Its structure is defined as followsintset.h: typedef struct intset { //Coding mode […]

  • High precision calculation

    Time:2021-4-14

    The simulation column vertical method is used for high precision calculation.Generally, positive numbers are used for calculation, and sign bits are used for negative numbers. 1. High precision data storage basic thoughtHigh precision integers are stored and represented by arrays. An array element that holds one bit of a high-precision integer.In order to facilitate the […]

  • PTA C language 7-6 cm converted to FT in

    Time:2021-4-13

    7-6 cm to FT in If the values of foot and inch are known, the corresponding meter is (foot + inch / 12) × 0.3048. Now, if the user enters centimeters, what are the feet and inches corresponding to the English length? Don’t forget that one foot is 12 inches. analysis The first time I […]

  • Duplicate data problem heboost

    Time:2021-4-12

                7-1. Duplicate data problem heboost (10 points)   It’s a common thing to find out the duplicate in a lot of data. Now we have to deal with many integers, in which there may be duplicate data. You need to write a program to do this, read in the data, and check for duplicate data. […]

  • Use native JS to find out the number of daffodils

    Time:2021-4-7

    Narcissus number:A three digit integer, the sum of cubes of number, ten and hundred is equal to the integer (example: 153 = 1 * 1 * 1 + 5 * 5 * 5 + 3 * 3) Step idea:1. Loop through in turn, output all three digits, rounding2. Set condition judgment3. Store output to array […]

  • On the storage of byte, ascll code and character

    Time:2021-4-3

    What is byte A byte is the unit in which data is stored. It is also the smallest unit that hardware can access. Previously, we said that a cup is called from memory and then executed. In memory, the program is stored bit by bit. But CPU can’t access every byte exactly. It can only […]

  • Java does not use system method to convert decimal to hexadecimal

    Time:2021-4-2

    Note: this code is just a conversion between integers. Public class test {public static void main (string [] args) {scanner sin = new scanner( System.in ); int index = sin.nextInt (); String res = “”; if (index == 0) { System.out.println (0); } else if (index > 0){ res = getRes(index); } else { index […]

  • Does bitmap understand? Used in what scene? What’s the problem?

    Time:2021-3-31

    The basic idea of bit map is to use a bit to mark the value corresponding to an element, and the key is the element. Because bit is used to store data, the storage space can be greatly saved. (PS: focus)Save storage space) Suppose there is such a requirement: find out whether a certain number […]

  • Linux shell programming (7) – flow control statement (1) conditional statement

    Time:2021-3-27

    1、 Two judgment formats Test judgment [judging formula] (commonly used) 2、 Judge by file type Test options effect -B document Determine whether the file exists and is a block device file -C file Determine whether the file exists and is a character device file -D document Determine whether the file exists and is a directory […]

  • Front end bug record – what is scientific counting?

    Time:2021-3-26

    Scientific counting is a method of counting.Features: precision loss, space saving What is scientific counting Express a number as a and aThe form of multiplication of n-th power of 10(1 ≤| a | < 10, a is not a fraction, n is an integer).19971400000000 == 1.99714×10^13 == 1.99714e13 When we want toTo mark or calculate […]

  • Data type in Java

    Time:2021-3-21

    1、 Basic types (eight) All of them are reference types except those on the table. From the table, except for byte, the value range of integer type can’t be known, so we can borrow their wrapper class to call the corresponding method to get the range value. The code is as follows:Integer type corresponding to […]

  • Delicious chocolate

    Time:2021-3-19

    Title Description The supermarket is selling chocolates at a special price, and lucky is being greedy_ Dog saw it.Chocolate from left to right in a row, a total of N, m kinds.There is a strange rule in the supermarket, that is, when you buy chocolate, you must provide two numbers a and B, representing that […]