First, the PTA experimental work Title 1: Location Code Input Method 1. PTA Submission List
2. Design ideas (1) Define integer variable code put location code, areacode area code, Digitcode place code, one put single digit, two put 10 digits, three put hundred number, four put thousand number (2) call scanf () Enter code (3) to separate and find the number of Chichong bits (4) Area code = Thousand *10+ Hundred +160 (5) Bit code = 10 digits *10+ single digit +160 (6) Output area code and bit code 3. Code
4. Problems encountered in commissioning process and PTA submission List status note
Description: The two variables, the high-byte and low-byte lows, were also defined at the outset, high=areacode+160;low=digitcode+160; it didn't seem to work, so it was removed, and then the area code and the bit code, That is, input 16 and 14 in the sample, then output separately, but found that no matter what input is the same result, so the previous result is an answer error. Finally try to separate the four numbers, and then find the area code and bit code, the answer is correct
Topic 2: Send red envelopes 1. PTA Submission List
2. Design ideas (1) define integer variable money,hundred=0,fifty=0,twenty=0,ten=0,five=0,two=0,one=0; (2) Enter the amount of money (4) to find the number of 100 Yuan: Hundred=money /100; (5) Count of 50 Yuan: fifty= (money-hundred*100)/50; (6) Count of 20: twenty= (money-hundred
100-fifty50)/20; By this formula 10 yuan, 5 yuan, 2 yuan, 1 yuan of the number (7) According to the output sample sequentially output the number of each denomination 3. Code
4. Problems encountered in commissioning process and PTA submission List status note
The answer is wrong: the idea of the first thought is to find out each denomination, but due to the calculation errors and output their sum sums resulting in an answer error
Format error: After the roommate prompted to correct the calculation, and then change the output to the sample output, but not in single-digit alignment, so the format is wrong
Partially correct: Change the number in the sample to%d, correct the last two, and I don't know why.
Correct answer: Last change to%3d, no space after colon
Topic 3: Simple Calculator 1. PTA Submission List
2. Design ideas (1) define the integer variable a,b,flag=0 the legitimacy of the symbol; Character variable op (2) Enter the first number a (3) when no = is encountered, enter the operand op if encountered =, then break ends (4) Enter second number B (5) if (op== ' + ') a= a+b; if (op== '-') a=a-b; if (op== '
') A=ab if (op== '/') if the denominator is 0 (b==0) operand error flag=1; otherwise a=a/b; (6) If OP is an illegal operator, that is, OP is not equal to +-*/,flag=1 (7) If flag=0, output operation result A, otherwise, output ERROE3. Code
4. Problems encountered in commissioning process and PTA submission List status note
Only the first number a is entered and the legality of the operand is not recorded with the flag, causing the answer to be partially correct
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 arrays are defined as: Type an array group name [array length], type an array group name [array length]={initial value table}
1.2 A one-dimensional array in-memory structure? can draw a description. What does an array name mean?
1.3 Why use arrays?
Because the array can hold many elements, it is easy to use.
1.4 Introduction to the selection method, bubble method, direct insertion sort how to sort? Pseudo code display.
Not a single law.
1.5 What is the binary search method? It differs from the order lookup method?
Do not understand the two-part search method, but also need to learn and understand
1.6 How are two-dimensional arrays defined and initialized?
Type an array group name [President] [column length] Type an array group name [President] [column length] ={{initial value table 0},{initial value table 1},.... {Initial value Table K} ...}
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.
Rows become columns, columns become rows. The relationship is a little vague, don't know how to say
1.8 What is the general application of two-dimensional arrays?
Matrix
2. This week's content, you are not what?
Not really very much, do not know where to start. The above selection method, bubbling method, the insertion method will not, the loop variable when a bit can not find the direction, when is which loop dizzy, leading to the code is never completely correct, do not know when you can at the end of the last here said will be a lot of, not only a little. Tears Rush ...
C Language Sixth Blog job-data type