Operations head
This work belongs to the curriculum | C Programming Language II |
---|---|
Where the job requires | Tenth jobs |
My aim in this course is | More familiar with the use of various functions to solve the PTA topic |
This job helped me achieve that goal in terms of specific | |
references | http://c.biancheng.net/view/305.html |
1.PTA lab assignments
Rank Pictures
1.1 topic name
7-8 outputs a triangular array of characters
present questions require programming, the output from the n-th row begins uppercase A triangular array of the character.
输入格式:
输入在一行中给出一个正整数n(1≤n<7)。
输出格式:
输出n行由大写字母A开始构成的三角形字符阵列。格式见输出样例,其中每个字母后面都有一个空格。
输入样例:
4
输出样例:
A B C D
E F G
H I
J
1.1.1 Data Processing
数据表达:用了n, j, i三个变量,
Data processing: data structures and processes used in expressions.
开始
定义字符型变量 c;
定义整形变量 n, i, a;
输入n;
while n≠0 do
for i←0 to n
输出 由A到B依次往后推字母
a←a+1
输出 “空格”
n←n-1
换行
结束
1.1.2 Screenshot experiment code
1.1.3 build test data
Input data | Output Data | Explanation |
---|---|---|
1 | Minimum number 1 in the input range | |
5 | SAMPLE INPUT | |
6 | Enter the number 6 | |
7 | Out of range of a digital input |
1.1.4PTA submit a list and description
Submit a list of instructions:
Topic name
7-3 Mersenne
Prime Number 2 n-1 is called Mersenne (Mersenne Number). E.g. 22-1 = 3-1 = 7 is 3,2 Mersenne. 1722, Switzerland blind master of mathematics Euler proved 231-1 = 2147483647 is a prime number, then called "the largest known prime number" of a world record.
This problem requires programming, for any positive integer n (n <20), the output of all Mersenne of not more than 2n-1.
`输入格式:`
输入在一行中给出正整数n(n<20)。
输出格式:
按从小到大的顺序输出所有不超过2n−1的梅森数,每行一个。如果完全没有,则输出“None”。
输入样例:
6
输出样例:
3 7 31
1.1.2 Data processing
数据表达:用了哪些变量,这些变量的值是怎么来的,类型是什么。
Data processing:
开始
定义整型变量 i,j,n,a
输入 n
for i←2 to n do
a←2^i-1
for j←2 to a do
if aMODj=0
跳出循环
if a=j
输出 a
否则输出 None
结束
1.2.2 Code Screenshot
1.2.3 build test data
Input data | Output Data | Explanation |
---|---|---|
6 | SAMPLE INPUT | |
19 | 19 digital input | |
29 | 29 digital input |
1.2.4PTA submit a list and description
- Partially correct: without taking into account the situation on the output if there is no "None" is.
Solution: put this situation into added.
2. Code peer assessment
My code Students Code
Students Code | My code |
---|---|
<1> The students used a for loop, and I use the while statement and the if-else branch structure.
<2> The students with the remainder of the while statement and its expression used in the back of the whole code.
3. learning summary
3.1 学习进度条
周 | 这周所花时间 | 代码行 | 学到的知识点简介 | 目前比较困惑的问题 |
---|---|---|---|---|
第七周 | 16个小时 | 105 | 学会运用分支结构和if-else结构 | 运算符方面没有很好的掌握 |
第八周 | 24个小时 | 126 | 学会运用for循环结构以及编写指定次数的循环程序 | 格式问题与不细心导致的问题 |
第九周 | 18个小时 | 150 | 自定义函数的应用 | 对于函数的定义还是不太熟悉 |
第十周 | 15个小时 | 熟悉使用多分支结构和逻辑运算符了解字符型数据类型 | 多分支结构运用不太熟练 | |
第十一周 | 11个小时 | 205 | 学会使用switch语句多分支结构 | 进制之间的转换 |
第十二周 | 8个小时 | 234 | do-while语句和while,for语句的区别 | 怎么写好伪代码 |
第十三周 | 9个小时 | 267 | 嵌套循环和continue语句的写法 | 怎么写好伪代码 |
3.2 累积代码行和博客字数(5分)
3.3 学习内容宗结和感悟
3.3.1 学习内容总结
思维导图
3.3.2 学习体会
发现在目前这个阶段,自己的题目还是做的太少了,导致做题目的某些时刻就是卡很久。所以在接下来的一段时间中,还是要多做题目。在做题目的期间,巩固自己所学过的知识。