Fifth jobs

Chapter 2 is written in C programming language - power generation function table 2.5 and table factorial. So that students have a preliminary understanding of the definition and call functions, you can imitate programming.

| This work belongs to that course | C Programming Language II |
| the job requirements where |
| My goal in this course is> | using functions and simple programming |
| References | C language programming ||

1.1 digits of an integer from 1 determines sum of squares of the name and the title can be divisible by 5

1.1.1 Write a function fun, which is: determining an integer and the sum of the squares of the digits can be divisible by 5, can be divisible by 5 returns 1, otherwise processing data 0.1

5 so as to be divisible returns 1, otherwise 0.1 data processing
data processing: a plurality of operators using a branched structure ,, defined sum argument, n-dummy argument
data expressed: using the integer data type. With fun defines the parameters and the type of a function declaration. Do the following as the first judgment while statement.
1.1.2 Experiment code theme

1.1.3 making test data
| data input | output data | Description |
| 5 |. 1 | be divisible by 5 |
| 5 | 5 |. 1 | be divisible by 5 |
| 5 |. 6 |. 8 | 0 | can not be divisible by 5 |
1.1.4PTA submit a list and description of
the teacher, the job I did on Saturday, did not chart screen shots, and I forget this crop yesterday

Submission Instructions: 1. The start did not recognize% can be taken directly to the remainder
2. Initially the sum = 0 is not clear, resulting in erroneous
3. Finally branching structure did not do a good job

1.2 Name Title 2 narcissistic number determination

Required to achieve a function, it is determined whether any integer number daffodils (three digits must be equal on every digit number and the number itself and cubic). E.g. 153 + 5 = 1 ^ 3 ^ 3 ^ 3 + 3 + 1 = 125 + 27 = 153, and 1 155 or not narcissistic number. If the number of daffodils, the function returns 1, otherwise it returns 0.

.1.2.1 Data processing: four argument defines abcd

Data representation: use of integer data types. With fun defines the parameters and the type of a function declaration.

1.2.3 build test data

| Input data | output data | Description |
| 147 | 0 | every cubic digital number and the number itself is equal to |
|. 9 | 0 | than three digits |
each digit | | 370 | 0 digital cube and the number itself is equal to |
| 3456 | 0 | than three digits |

Submission Instructions: 1. not properly express one hundred, ten, a digit
2. relational operators did not use good

3. learning summary


Exactly the same, except for the definition of different variables

3. learning summary

| Week / Date | time spent | line | knowledge learned in Introduction to point | currently more confusing issues |
| | 10H | 89 | function declaration, defining and calling | parameter, the argument of the substantive difference |

summarize

Learning Summary: number modulo percent sign
tell arguments and imaginary reference
learn to produce their own mind maps and self-summary knowledge
there is a mentality problem, it had to do pta is the mentality of the explosion
learn simple programming, by designing three dummy argument result1, resukt2, result3 to simple programming

Guess you like

Origin www.cnblogs.com/csmzlw53719/p/11725784.html