First, the PTA experimental work Title 1:7-4 print diamond pattern 1. PTA Submission List
2. Design Ideas
4. Problems encountered in debugging process and PTA Submission List situation description.
2. Design Ideas
4. Problems encountered in debugging process and PTA Submission List situation description.
- 1. At first my idea was to use loops to solve the problem, but either get into a loop of death or the answer is wrong.
- 2, later I looked at several topics, notice the problem from large to small requirements, found that only from large to small amount of money and coins, you can get the corresponding output requirements
3, also, the output format has certain requirements, the space to pay attention to good, I have begun to use is%-3d, is wrong, to use%3d to
Topic 3:7-10 Simple Calculator 1. PTA Submission List
2. Design Ideas
4. Problems encountered in debugging process and PTA Submission List situation description.
- 1, initially forgot to Judge division sign after the situation of zero = =
2, at first I only use result to calculate the results, Number1 is only used to store the first number, but this is only partially correct, the output of the sample is wrong
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?
Increment the corresponding number of bytes from the start address
2, the array name is an address constant, is the first address that holds the array memory space
1.3 Why use arrays?
The array has the advantages of simple expression, good readability and easy to adapt to the loop structure. Arrays are easier to understand when you need to express a large number of variables of the same type.
1.4 Introduction to the selection method, bubble method, direct insertion sort how to sort? Pseudo code display.
- 1. Selection Method:
- Starting from the first number for (k=0;k<n-1;k++)
- Compares a number to other numbers for (i=k+1;i<n;i++)
- Compare the minimum and first number when comparing the IF (A[i]<a[index])
- And then the next number, compared to the subsequent number, so loop until the last number
- 2. Bubbling method:
- for (k=0;k<n-1;k++) max=k
- for (i=0;i<n-1-i;i++) the first number is compared with the following number in turn
- if (A[i]>a[max]) Exchange two numbers, storing large values in A[max]
- 3. Direct Insert Sort
- for (k=1;k<n-1;k++) j=k
- for (i=k;i>0;i--) I must start from K
if (A[j]<a[i-1]) swaps the values of both
1.5 What is the binary search method? It differs from the order lookup method?
- 1, the binary search method is the number to be found and the array in the middle of the comparison, in order to narrow the boundary until the location of the number to find
2, binary search method for ordered array, the advantage is that the search speed is fast, and sequential lookup method is slow, but when the array is unordered, can not apply the binary search method
1.6 How are two-dimensional arrays defined and initialized?
- 1, two-dimensional array includes array type, array name, array row and column length
2, the branch assigns the initial value, the order assigns the initial value
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.
1, the main diagonal for the boundary, the ranks of the interchange
-2, Lower triangle: i>=j, Upper triangle: i<=j, symmetric matrix: i==j
1.8 What is the general application of a two-dimensional array?
Mainly used to represent two-dimensional tables and matrices
2. This week's content, you are not what?
- 1, the problem understanding is not enough, easy to make some small mistakes
- 2, for the application of the array, the feeling is not very understanding, the use of unskilled
3, for the data sort, not very clear, understanding is not thorough
C Language Data type jobs