C language blog I work 08

One two
This work belongs courses C Programming Language II
Where the job requires https://www.cnblogs.com/pengchen511/p/10564067.html
My aim in this course is Fluent in C programming language, and be able to make your own simple software
This job helped me achieve that goal in terms of specific Familiar with while and do-while structure to solve the problem
references https://edu.cnblogs.com/campus/zswxy/SE2019-1/homework/9980

1.PTA lab assignments

1.1 crawling worms

A length of 1 inch worm, the bottom of an inch deep N well. The worm is known inch per minute to climb U, but must then rest for 1 minute to climb. During the break, the worm has dropped D inch. In this way, climb and glide repeated. I ask, how long it takes to climb out of worms well?

Here requires less than 1 minute in 1 minutes, and assuming that as long as a particular climb during the worm's head reached the top of the well, then the worm to complete the task. Initially, the worm is lying at the bottom (i.e. a height of 0.

1.1.1 Data Processing

Data are expressed: defines the integer variable N, U, D, s, t. Denote depth, height of rise, fall height, climb displacement time.
data processing:

1.1.2 Screenshot experiment code

1.1.3 build test data

Input data Output Data Explanation
12 3 1 11 Sample
15 3 1 13 Explanation
15 4 3 23 Explanation

1.1.4 PTA submit a list and description


1. Compile Error: forget to add a semicolon after the break.
2. Wrong Answer: break the worm was not calculated.

1.2 Binary Coded Decimal

Input a set of binary characters, and outputs the corresponding decimal number. When you enter the Enter key, enter the end. If non-binary character input, output error input!

1.2.1 Data Processing

Data are expressed: The definition of the character char variable ch, integer variables num, read function getchar.
data processing:

1.2.2 Code Screenshot

1.2.3 build test data

Input data Output Data Explanation
11111111 255 Sample
34 error input! Explanation
10101010 170 Explanation

1.2.4PTA submit a list and description


1 partially correct: forgets the value of 1 in addition must add 1 * 2.
2. partially correct: do not realize the difference between a break and return.

2. Code peer assessment

Students Code:


My code:



1. My classmates code more concise compared to more logical, my code is very long, accounting for a large space, is relatively simple.
2. I am a leap year will be calculated separately in peace, and the students are divided into 31 days of each month, 30 days of each month, and special circumstances in February. He's better, my stupid little brute.

3. learning summary

3.1 learning progress bar

date This week the time spent Lines of code Learned Introduction Currently more confusing issues
10.7-10.13 7 hours 80+ Compile if-else statements, variables, data types is not clear, arithmetic and assignment operator And can not distinguish between Chinese and British symbols
10.14-10.20 5 hours 90+ Compiled for statement, specifying the number of cycles Programming Nested if-else statements
10.21-10.27 5 hours 140+ Learning the function definition Distinguishing function
10.28-11.3 6 hours 150+ Learn to use a multi-branched structure, character data types and logical operators X represents the logical operator 0 is the expression of several
11.04-11.10 5 hours 200+ Familiar with multi-branch structure of the switch statement no
11.11-11.17 6 hours 300+ Familiar with while and do-while structure to solve the problem While some of the differences in structure and do-while

3.2 Cumulative lines of code words and blog

3.3 Summary and perception of learning content

3.3.1 learning content summary

3.3.2 Learning Experience

This week learning the do-while loop and a while, I feel two difficult to distinguish, may be understood not in place. PTA has improved the difficulty of the job, especially in this week's third title Binary Coded Decimal divisible bachelor and fifth questions are not easy to solve the problem.
This week the C language learning is still very abundant and happy.

Guess you like

Origin www.cnblogs.com/zc18473439693/p/11848419.html