This work belongs courses | C Programming Language II |
---|---|
Where the job requires | Work requirements |
My aim in this course is | Itself can be familiar with C language |
My aim in this course is | Exercise for loop, break statement, for nested statements and character variables |
references | Baidu |
1.PTA lab assignments
Output triangle array of characters 1.1
This problem requires programming, the output from the n-th row begins uppercase A triangular array of the character.
1.1.1 Data Processing
Data are expressed: provided m, n, i, j four integer variables
Data processing:
{
Define integer n, m = 0, i, j
input n-
for (I = n-; if I is greater than 0; then i--)
{
for (j = 0; if j is less than I; j ++)
{
output A + m ( note the space)
m ++;
}
output format newline
}
1.1.2 Screenshot experiment code
1.1.3 build test data
Input data | Output Data | Explanation |
---|---|---|
5 | A B C D E F G H I J K L M N O |
random |
1 | A | random |
1.1.4 PTA submit a list and description
Malformed: + + + forget in a hit
compilation error:% c% d hit into
1.2 Mersenne numbers
1.2.1 Data Processing
Data are expressed: set n, x, y, i, num five integer variable
data processing:
{
定义n,x,y,i,num五个整形变量
输入x
如果x等于1
输出None
for(n=2;n小于等于x时;n加1)
{
num=2的n次方-1;
for(i=2;当i小于等于num-1时;i加1)
{
如果(num除以i能被整除)
{
y=1;
跳出循环;
}
}
如果(y不等于1)
输出num;
y等于0;
}
1.2.2实验代码截图
1.2.3造测试数据
输入数据 | 输出数据 | 说明 |
---|---|---|
10 | 3 7 31 127 |
随机 |
12 | 3 7 31 127 |
随机 |
1.2.4 PTA提交列表及说明
编译错误:使用了中文符号
编译错误:少打了一个括号,后来自己找出来的
2.代码互评
同学代码:
我的代码:
1.自我感觉代码原理相差不大,不过我的更加简便化了,但直观看来同学的代码比我的代码更加容易让人理解。
2.我认为同学代码中的一些大括号没有必要,虽然感觉条理清晰,但是的确是一些多余的存在。
3. 学习总结和感悟
3.1学习进度条
日期 | 这周所花时间 | 代码行 | 学到的知识简介 | 目前比较迷惑的问题 |
---|---|---|---|---|
10.7--10.13 | 8小时左右 | 89 | 学习了if-else语句的用法 | 一些代码和函数之间的不同比较模糊 |
10.14--10.20 | 8小时左右 | 120 | 学会了区分整型变量和浮点型变量,学会了for语句的使用方法 | 自己写代码还不能独立流畅的完成,每次都需要去查阅大量资料和询问同学 |
10.21--10.27 | 7小时左右 | 83 | 函数的定义,调用 | 对调用函数还不是很熟练,变量经常弄错 |
10.28--11.3 | 8小时左右 | 230行左右 | 学习程序解析和多分支if-else语句 | 经常将分号的使用方法弄错 |
11.4--11.8 | 5小时左右 | 223 | 学习了switch语句 | |
11.9--11.15 | 9小时左右 | 166 | 进一步地理解循环语句的区别和用法 | 对语句的理解还不是很透彻,无法找到最简便的语句来编写代码 |
11.20--11.22 | 7小时左右 | 135 | 学习了break和continue使用,循环的嵌套 | 对continue还并不是很理解 |
11.27--11.29 | 8小时左右 | 120+ | 本周没有学习什么新的知识,主要是观看助教写的代码,同时反思自己的差距 | 对各种英文字母所定义还不是很理解 |
3.2 累积代码行和博客字数
3.3 学习内容总结和感悟
3.3.1学习内容总结
3.3.2学习体会
1.这周虽然没有学习什么新知识,但是在观看助教讲解代码时还是学了很多东西,我学习到了他们做题的思路和方法,能帮助我更好的完成pta
2.一学期快要将近尾声了,说学其实感觉没学到多少,说不学好像又学到了点什么,自己也总会在一写细节上出错。