C language I-2019 autumn work 05

This work belongs to the curriculum C Programming Language II
Where the job requires https://edu.cnblogs.com/campus/zswxy/SE2019-2/homework/9830
My aim in this course is Have a preliminary understanding of the definition and call functions, can be programmed to mimic
This job helped me achieve that goal in terms of specific C language program that can generate power table with factorial table
references "Markdown basic grammar" "c programming language" "ACM problem-solving."

 

 

 

 

 

 

 

 

 

 

 

 

 

1.PTA lab assignments

1.1 daffodils JUDGMENT

Description Title: The title required to achieve a function, it is determined whether any integer number daffodils (three digits must be equal on every digit number and the number itself and cubic). E.g. 153 + 5 = 1 ^ 3 ^ 3 ^ 3 + 3 + 1 = 125 + 27 = 153, and 1 155 or not narcissistic number. If the number of daffodils, the function returns 1, otherwise it returns 0.

1.1.1 Data Processing

Expression data: 1. the definition of variables sum, a, N

                 2.sum is a three-digit numbers on each of the cube and

                 3. This encoding uses the while statement and if statements

Data processing: 1. expression: SUM = + (10% A) * (A% 10) * (10% A)

                 2. Process Structure: cyclic structure and a branched structure

Function parameters: 1 calling function name:. Main

              2. The name of the called function: func

              3. The called function type: Integer function

1.1.2 Screenshot experiment code

 

 

1.1.3 build test data

 

         Input data            Output Data      Explanation
           108                0    Non-prime number
           370                1      Prime numbers
           666                0    Non-prime number 
           999                0    Non-prime number 

 

 

 

 

 

 

 

 

 

1.1.4PTA submit a list and description

 

 Compile Error: 1 symbols, characters and other non-standard, or write some characters and symbols written in Chinese-style leak

                  2. What statement did not clarify the use and lead to coding errors

 

1.2 Goldbach conjecture verification function 

Description Title: Analyzing this question required to achieve a simple function of the number of elements, and using the verification function Goldbach conjecture: any even a not less than 6 can be expressed as the sum of two odd prime. Is the only prime number is divisible by 1 and itself is a positive integer. Note: 1 is not a prime number, 2 is a prime number.

1.2.1 Data Processing

Expression data: 1. the definition of variables p, i, flag, n, p, q

                 2. The prime function of an integer variable flag defined, the function defined Goldbach p, q is the integer variables

                 3. This coding uses if statements and for statements

Data processing: 1 expression: None

                 2. Process Structure: cyclic structure and a branched structure

Function parameters: 1 calling function name:. Main

                 2. The name of the called function: prime, Goldbach

                 3. The called function type: prime integer function, Goldbach function is empty

1.2.2 Code Screenshot

 

 

 

1.2.3 build test data

 

 Input data            Output Data      Explanation
11、18  11 is a prime number  11 is a prime number
19、27  19 is a prime number  19 is a prime number
66、99  no  No prime number

 

 

 

 

 

 

 

 

 

 

 

1.2.4PTA submit a list and description

 

 Compile Error: 1 start I do not know what kind of looping structure to use, what kind of statement, what the use of variable, after several attempts to gradually straighten out the ideas

                  2. The character is entered incorrectly

Malformed: 1 head and tail output of more spaces and line breaks

              Note 2. The output is not subject in full accordance with the output required output, did not see the title

 

2. Code peer assessment

Others Code:

 

 

 

 

My code:

Peer assessment: 1. my code with other people in the prime function the same code structure part, but the content is different. Others codes If the input data is a prime number returned, otherwise return 0; I define In Flag, if the input data is a prime number then the flag = 0, and vice versa flag = 1 and return to flag.

        2.在Goldbach函数部分他人代码使用while语句,我的代码中使用if语句和for语句。

        3.在Goldbach函数部分要将整数分解成两部分,然后判断分解出的两个整数是否都为素数。如是,则输出;否则,重新分解、判断。故这只是有限的验证,不能作为对哥德巴赫猜想的证明。

 

3.学习总结

3.1学习进度条

周/日期 周所花的时间 代码行 学到的知识简介 目前比较迷惑的问题
5/20~5/26    9h 119 分支结构与循环结构的共同使用 流程结构的选择应用和语句的正确用法

 

 

 

 

 

 

 

 

3.2累计代码行数和博客字数

    时间       博客字数      代码行数
  第一周          800           0
  第二周        1299         16行
  第三周        2019         98行
  第四周        2035        109行
  第五周        2049        119行

 

 

 

 

 

3.3学习内容总结和感悟

3.3.1学习总结内容

 

 

 3.3.2学习体会

1.学习的时候一定要记笔记:记笔记可以加深印象,而且,忘记了也便于查找,不用一本书的去翻.

 

2.真正学到的知识是我接受了,而不是我知道了:对于知识的掌握,我认为应该是接受了这个知识并能知道如何运用它,而不是单纯的知道它的存在。

 

3.一定要上机做题:实践是检验真理的唯一标准

 

Guess you like

Origin www.cnblogs.com/yuzhe1/p/11732230.html