Question 20th:Title: Enter a String representing an integer to convert the string to an integer and output.For example, the input string "345", the output integer 345Idea: Atoi is mainly concerned with the calibration and boundary processing of the input, as well as the processing of positive and negative symbols.1 PackageCom.rui.microsoft;2 3 Public classTest20_string2int {4 5 Public Static voidMain (string[] args) {6 intsum = Test20_string2int.convert ("2147483648");7 System.out
[Programmer interview questions: 100] 5. Find the minimum k elements, Programmer[Question]
Enter n integers and the minimum k integers.
For example, if you enter the 8 numbers 1, 2, 3, 5, 6, 7, and 8, the minimum four digits are 1, 2, 3, and 4.[Analysis]
The simplest way to solve this problem is to sort the input n integers so that the number of k at the top is the minimum number of k. The time complexity
For a relaxing weekend, do some more questions.Original title Link: http://www.runoob.com/python/python-exercise-example22.htmltitle: Two table tennis team to play, each out three people. Team A for A,b,c three, team B for X, Y, z three people. Have drawn lots to determine the contest list. Someone asked the team for a list of matches. A says he does not compare with X, C says he does not compare with x,z, please compile the procedure to find out the list of the three teams.Analysis: This questi
Original title Link: http://www.runoob.com/python/python-exercise-example18.htmlTitle: The value of S=A+AA+AAA+AAAA+AA...A, where a is a number. For example 2+22+222+2222+22222 (a total of 5 numbers are added at this time), several numbers are added by keyboard control.Analysis: Summing is easy, the key is to calculate the value of each item. I used loops to iterate over the values of each item.My Code:defFun (): a=int (Input ("Please input a number:")) b=int (Input ("How many numbers to add:"))
Title: Learn to use bitwise AND .Not the knowledge point, checked the bitwise operation.A bitwise operator computes a number as a binary.
operator
Description
Example
Bitwise AND Operator: Two values that participate in the operation, if two corresponding bits are 1, the result of that bit is 1, otherwise 0
(A B) Output result 12, binary interpretation: 0000 1100
|
Bitwise OR operator: As long as the corresponding two binar
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.