This work belongs to the curriculum |
C Programming Language 1 |
Where the job requires |
https://edu.cnblogs.com/campus/zswxy/CST2019-2/ |
My aim in this course is |
To learn and master the C language |
This job helped me achieve that goal in terms of specific |
I learned to use the% 02d |
references |
C Programming Language Textbooks |
Four job format
1PTA job map
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101213333316-679501245.png)
1.1 Title name 17-3 calculates the train run time, according to the present problem requires the train departure time and arrival time, programming time is calculated as used throughout the journey, two 4-bit input is given a positive integer in a row, separated by spaces therebetween, respectively, express train departure and arrival times. The format of each bit time is 2 (00-23) minutes and two (00-59) hours, assuming arriving and departing on the same day.
1.1.1 Data Processing
数据表达:i,n,t,i表示骑车的时间,n表示走路的时间,t表示俩个时间相减。
数据处理:t = n - i;%02d:%02d",t/100,t%100,其中%02d表示输出两位整数,不足两位用0补充。
1.1.2 experiment code map
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101183149434-654923316.png)
1.1.3 build test data:
1301 |
1405 |
01:04 |
1607 |
2043 |
04:36 |
0023 |
2356 |
23:33 |
1.1.4PTA submit and explain:
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101183835294-139735430.png)
1) Wrong Answer: First, second, third time I have not found my real reason for the error, and finally I carefully double check I discovered that I write less a = == should be.
1.2 grade point average and the number of passes topic 27-4 statistics student, this question requires programming to calculate students' grade point average, and statistical pass (score of 60 points) number. Title ensure that the input and the output are within the range of integer, non-negative integer N input is given in the first row, i.e., the number of students. The second line gives a non-negative integer N, i.e., N bits which student performance, separated by a space therebetween.
1.2.1 Data processing:
数据表达:N, i, a[100], count这些是整型,sum, average这些是浮点型。a[100]意思是a可以定义100个。
数据处理:sum += a[i],表示sum累加定义a,average=sum/N,a[i] >= 60,count++这俩个表示每有一个大于六十的分数,count就加一。
1.2.2 Code Screenshot
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101195634364-1336866755.png)
1.2.3 build test data:
6,78 76 66 79 86 80 |
average = 77.5,count = 6 |
| |
5,45 70 76 80 86 |
average = 71.4,count = 4 |
count not less than 60 points plus 1 |
6,34 70 56 76 80 60 |
average = 62.7,count = 4 |
| |
1.2.4PTA submit and explain
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101212522004-88479575.png)
Initially did not know how to express n student scores.
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101212651686-1360519366.png)
After ask seniors understand a [1000] of use, is also known for the gradual addition in the loop.
2 Code peer assessment
Topic: Calculate train running time
Yourself:![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101204740132-977332847.png)
Xu Qingqing:![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101204715727-1435208228.png)
代码区别:1)他把小时,分钟,出发到达时间都定义了,整体看起来比我要复杂一些,后面的我有点没看懂。
2)我用if-else做基础,定义俩个时间俩时间相减对比,最后用%02d收尾。
The number of grade point average and the number of students passing statistics, programming requirements, calculate students' grade point average, and statistical pass (score of 60 points): The title. Title ensure that input and output are in the range of integer
Yourself:![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101211540290-1388898001.png)
Xu Qingqing:![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101211715203-10847844.png)
代码区别:1)他调用了函数,而我没有
2)我觉得我们应该这样定义分数score[]因为我们不知道n是多少,我觉得他这一点不足。
3. learning summary
3.2 learning progress bar
the first week |
Three hours |
60 |
First understand the meaning of the code |
Do not know when and when not to blank spaces |
the second week |
Four hours |
100 |
You know how to create a table |
% D symbols of what many do not know |
The third week |
Seven hours |
170 |
and if-else format && |
None of the code is written exactly the same |
the fourth week |
Seven hours |
150 |
I learned for statement |
This week the job is relatively simple basic know everything |
fifth week |
Six hours |
160 |
Learned to call the function, I learned to debug, find coding errors |
/ |
Sixth Week |
Seven hours |
170 |
Learned% 02d, clear definition [] of meaning |
I do not know how to express hh: mm |
Cumulative lines of code words and blog
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101201724453-1304528558.png)
3.3.1 learning content summary
![](https://img2018.cnblogs.com/blog/1806736/201911/1806736-20191101203918431-2051368457.png)
3.3.2 Learning Experience
每次写作业都有一种飘飘欲仙的感觉,感觉自己的能力在飞速上升。还是那句话,上课认真听,下课努力往下预习,很多事都要自己慢慢去摸索,一味去找答案师妹用的,加油!