The number of digits is not enough. The $ symbol is used on the left to supplement the number of digits.

Source: Internet
Author: User

The number of digits is not enough. The $ symbol is used on the left to supplement the number of digits.

The string to be processed must be 5 characters in length as required. If the number of digits is not long enough, use the "$" symbol before (left.

In fact, this problem is not difficult to implement, because the C # program has this function, which is called the PadLeft () method.

The following Insus. NET page lists several examples:

 

Now, we need to read the Label + ODD value, complete the processing, and display it on the Label + even number Label. This involves dealing with parity. In this example, there are eight labels. Therefore, for 8. % Is used for odd even numbers.


The execution result is as follows. If the number of digits is a combination, the original value is displayed.

 


In an EXCEL table, how do I set up the insufficient median with symbols?

Hello,
For example, A1 = 111, and the number of digits must be 10 digits,
1. Fill in the symbol "#" on the left. The formula is as follows:
B1 = REPT ("#", (10-LEN (A1) & A1
2. Fill in the symbol "#" on the right. The formula is as follows:
B1 = A1 & REPT ("#", (10-LEN (A1 )))

Calculate the complement of the following numbers

Are all negative numbers?
(1)
Binary representation of 16: 1 0000
Because the total number is less than 7 digits (the first digit is the sign bit, indicating positive and negative digits), add zero to the left of the highest digit (the right side of the sign bit) in the seven digits to supplement.
Because it is a negative number, the symbol bit is 1
Original code: 1001 0000
Anticode: The negative number of the anticode, the symbol bit remains unchanged, and the value part is reversed by bit.
1110 1111
Complement: Anti-code + 1
1111 0000

(2)
Method for decimal original code:
The integer part of 0.1875 is 0. Because it is a negative number, the first part is 1.
The decimal part is 0.1875.
0.1875 × 2 = 0.375 <1 digit decimal part first from the left is 0
0.375 × 2 = 0.75 <1 digit decimal part from left to second is 0
0.75 × 2 = 1.5> 1. The third digit from the left of the decimal part is 1.
Then take the decimal part of 1.5.
0.5 × 2 = 1 ≥1. The fourth digit from the left is 1.
Because the total number is less than 7 digits (the first digit indicates positive and negative digits), add zero to the right of the decimal digit to supplement.

Original code: 1.001 1000
Reverse code: 1.110 0111
Makeup: 1.110 1000
(3)
2FH is in hexadecimal format, and the binary format is 0010 1111 (H indicates hexadecimal format)
Original code: 1010 1111
Reverse code: 1101 0000
Makeup: 1101 0001
Can this happen?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.