5.x!=1 output I if x==1 output error
3. Code4. Problems encountered in debugging process and PTA Submission List situation description.
No judgment is made on the case that the divisor is zero and the illegal operator
Second, this week's topic set PTA Final ranking.Iii. Summary of this week's study 1. What have you learned? 1.1 How is a one-dimensional array defined and initialized?
One-dimensional array definition requires explicit array variable names, array element types and arrays, in general form: type name variable name [array length]
When an array is initialized, the array element is assigned an initial value, in the general form: the type name variable name [array length]={initial value table} (can only be for partial elements)
1.2 A one-dimensional array in-memory structure? can draw a description. What does an array name mean?Structure as shown in Figure 7.2 of the textbook 150 page
The array name represents the address of the first cell in the contiguous memory space allocated by the array
1.3 Why use arrays?Arrays allow a set of identical types of data to be arranged in an orderly manner and stored continuously for ease of use.
1.4 Introduction to the selection method, bubble method, direct insertion sort how to sort? Pseudo-code display. Selection Method:
3. Repeat 2 until the number is not preceded by a number or the previous number is larger than
1.5 What is the binary search method? It differs from the order lookup method?Binary Search method: First determine the midpoint position of the interval, compare the x value of unknown origin with A[mid], if equal, find the success and return to this position, if a[mid]>x, then the new search interval is a[1..mid-1] If a[mid]<x, then the new search interval is a[mid+ 1..N]
The binary lookup method is applied to the sorted array, it is not necessary to compare each element, the speed is fast, and the sequential lookup method is used to repeat the group
1.6 How are two-dimensional arrays defined and initialized?Definition: Type an array group name [President] [column length]
Initialize: The initial value of the branch is assigned: int a [3] [3] ={{3}, {4,5,6}, {7,8,9}}, the order is assigned the initial value: int a [] [3] = {1,2,3,4,5,6,7,8,9}
1.7 How is the matrix transpose implemented? In the matrix: the relationship between the row label I of the lower triangle, the upper triangle and the symmetric matrix J? Please state.The elements on the diagonal are unchanged, the remaining elements are two subscript interchangeable
Upper triangle: i<=j
Lower triangle: i>=j
Symmetric matrix: A[i][j]==a[j][i]
1.8 What is the general application of a two-dimensional array?Matrix, table
2. This week's content, you are not what?For the part of the two-dimensional array is unfamiliar, some basic conceptual questions in the exam questions, as well as for handwritten code, the exam found that the knowledge of the function part is still not strong. For an array just know its basic concept, it involves the application level of the problem is cool. PTA in some need to judge the problem, not the first time to come up with the method of judgment sometimes forget to judge. Some of the topics are meant to be understood.