C language l- blog work 04

This work belongs to the curriculum C Programming Language II
Where the job requires https://edu.cnblogs.com/campus/zswxy/SE2019-3/homework/9775
My aim in this course is Master the use of the for loop cycle design program
This job helped me achieve that goal in terms of specific Understanding of the for loop as well as the gradual understanding of the use of loops
references C language textbook

1.PTA lab assignments

1.1 title of this title

Requires two positive integers m and n (m≤n) programming, and calculates the sequence m 2 + 1 / m + ( m + 1) 2 + 1 / (m + 1) + ⋯ + n2 + 1 / n .
Input format
input given two positive integers m and n (m≤n) in a row, separated by spaces therebetween.
Output format
output portion and the value S in accordance with the "sum = S" format in a row, accurate to six decimal places. Title ensure that the calculation result does not exceed the double precision.

1.1.1 Data Processing

Data are expressed: variables i, m, n, and floating point variable S, sum
the data processing: the use of the statement and pow sum = sum + pow (i, 2) + 1.0 / i modes of operation

1.1.2 Screenshot experiment Code

1.1.3 build test data

Input data Output Data Explanation
10 sum=2.133256 And the first ten
20 sum=2.479673 A sum of the top twenty
100 sum=3.284342 The sum of one hundred before

1.1.4PTA submit a list and description


Description: accidentally floating-point and integer confused, and at the end of the semicolon is incorrect.

1.2 title of this title

This requires programming problem, the sequence of staggered 1-2 / 3 + 3 / 5-4 / 7 + 5 / 9-6 / 11 + ... and the first N.
Input format:
input line in a given positive integer N.
Output format:
output section and a value in a row, the results of three decimal places.

1.2.1 Data Processing

Data are expressed: variable flag, i, n and denominator, float variables sum and item
data processing: the use of the for loop statement, as well as new modes of operation variables and

1.2.2 Screenshot Code

1.2.3 build test data

Input data Output Data Explanation
5 0.917 And the first five of the
11 0.904 Before eleven sum
16 0.385 Former sixteen sum

1.2.4PTA submit a list and description


Note: This question I used two methods, the first method is to play no matter how wrong, then search the Internet, using another method, the beginning is always the symbols and letters with an error occurred while, and for statements the double not know why you want to appear.
2. Code peer assessment

2.1 Screenshot students Code

2.2 Screenshot their own codes


Description:
I'm the code more complicated, complex, his than mine concise, easier to understand;
his assignment with the letters, I use the word assignment, looks a bit complicated.
3. learning summary

3.1 learning progress bar

Week / Date This week the time spent Lines of code Learned Introduction Currently puzzling question
7/2019.10.11 14 280 scanf, if else statements For scanf statements still do not understand
8/2019.10.17 16 320 for the loop and the loop body For the body of the loop is not really understand, for in the primary loop also understand the mode

3.2 Cumulative lines of code words and blog

3.3 Summary and perception of learning content

3.3.1 learning content summary

Learning new knowledge, cyclic structure for, and understanding of the components of the cyclic structure and further improve on the for loop used in the basic operation of the program, though not too skilled, but can ask about it and in the future of learning their expertise.

3.3.2 learn insights

Become more familiar with the C language to develop an understanding of programming;
learned a lot of expertise, and will be more familiar with the programming operations and the learning of new knowledge and consolidate the knowledge learned;
not only to lectures, but also to learn on their own initiative , good preparation, gradually found wanting in practice and learning, to correct their own mistakes often committed.

Guess you like

Origin www.cnblogs.com/hsyzq/p/11696067.html