Tag：integer

Time：2021415
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 […]

Time：2021414
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 highprecision integer.In order to facilitate the […]

Time：2021413
76 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 […]

Time：2021412
71. 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. […]

Time：202147
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 […]

Time：202143
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 […]

Time：202142
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 […]

Time：2021331
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 […]

Time：2021327
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 […]

Time：2021326
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 nth 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 […]

Time：2021321
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 […]

Time：2021319
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 […]