First, the PTA experimental work 1. Symbolic function 1. PTA Submission List
2. Design Ideas
Topic 2. Use function to output Narcissus number 1. PTA Submission List
2. Design Ideas
- (1) Defining integer variables I, j, Digit, Power, Powersum, Integer, count=0
- (2) Integer = number
- (3) using the while loop, if integer > 0,integer = INTEGER/10, count the number of numbers, count the number of digits
- (4) Integer = number
- (5) using a For loop, i = 0; I < count; i++,digit = integer% 10,integer = integer/10,j = 0; J < Count; J++,power = power*digit,powersum=powersum + Power
- (6) If powersum==number, return 1, otherwise return 2
- (7) Define sub-function void printn (int m, int n)
- (8) Definition I
- (9) Use the For loop to accumulate I until m+1=n
(10) If narcissistic (i) =1 output I
3. Problems encountered during commissioning and solutionsI didn't pay attention at first. To redefine the initial value of the powersum, resulting in the result has not been lost
Topic 3. Number of combinations 1. PTA Submission List
2. Design Ideas
Second, peer code pairs of peer review 1. Peer Reviews Photos
2. My Code, mutual evaluation of the student code
3. Where do I differ from my classmates ' code? What are the advantages? What style of code do you prefer?
Bo Han's code with the POW function to solve, and I do not, I feel my code is more concise, looks more comfortable, but our code is not annotated, need to improve later
Third, this week's topic set PTA Final Ranking
Iv. Learning Summary 1. What have you learned? What data types are 1.1 C languages?
Integer floating-point character type
1.2 Character type data need to be aware of the place?
Use%c,getchar () to add single quotes when entering
1.3 Self-increment decrement operator?
n++ represents the value of N plus 1, but n++ equals the original n,++n represents the value of N plus 1, but n++ equals the current n
1.4 Operator Precedence?
superior to low elementary operator single-mesh operator arithmetic operator shift operator relational operator bitwise logical operator logical operator three-mesh operator assignment operator comma operator
2. This week's content, you are not what?
- (1) will not be a lot of places, the function of a little more complex point of no idea, to go online to see other people's code ideas to play out
- (2) The self-increment decrement operator is not very clear, the expression is easily mistaken
(3) Operator Precedence cannot be remembered, and it is easy to be mistaken during operation
3. Circular Structure Examination SummaryThe exam is very poor, the first exam can pass, this time by the second problem card half-dead, feeling now learning more difficult, a little rare to keep up with the teacher's progress, from the cycle structure began a bit will not, my own learning attitude also a bit of a problem, I learned that the professional university there is nothing to play, honestly dozen code it, After these two examinations, the heart is still relatively lost, hoping to slowly adjust to come, will not understand, and strive to keep up with the footsteps of teachers and classmates.
C Language Blog Job--function