The third homework of the second semester

Homework requirement one (20 points)

1) C Advanced Third PTA Assignment (1)

2) A programming question:

There is an array of axb, which sequentially stores numbers from 1 to a*b. Where a is the first three digits of your university number, and b is the last four digits of your university number. For example, if your student number is 2017023936, then the array size is 201 x 3936, and the array is sequentially stored from 1 to 791136 (201 and The integer of the product of 3936). It is required to use the screening method to find out the prime numbers in the array and print them out. The print format is 5 prime numbers on one line, and the numbers are separated by spaces.

The specific method of the screening method is to first arrange the N natural numbers in order. 1 is not a prime number, nor is it a composite number, it should be crossed out. The second number 2 is a prime number left over, and all numbers that are divisible by 2 after 2 are crossed out. The first number that is not crossed out after the 2 is 3, leave the 3, and then cross out all the numbers after the 3 that are divisible by 3. The first uncrossed number after the 3 is 5, leave the 5, and then cross out all the numbers after the 5 that are divisible by 5. Doing this all the time will filter out all composite numbers up to N, leaving all prime numbers up to N.

1. Design ideas (6 points)

 (1)主要描述题目算法(2分)。可以用文字描述(不允许使用伪代码),如:
  

  (2)流程图(4分)

2. Experiment code (2 points)

Part of the code:

    char *getmonth( int n )

{
switch(n)
{
case 1:return "January";
case 2:return "February";
case 3:return "March";
case 4:return "April";
case 5:return "May";
case 6:return "June";
case 7:return "July";
case 8:return "August";
case 9:return "September";
case 10:return "October";
case 11:return "November";
case 12:return "December";
default:return NULL;
}
}

3. Problems encountered in the debugging process of this question and solutions (4 points)

Homework requirement 2 (65 points)
6-1 English name of the output month 1. Design ideas (6 points)
1. Design ideas (6 points)

 (1)主要描述题目算法(2分)。可以用文字描述(不允许使用伪代码),如:
     第一步:###
     第二步:###
      ......

  (2)流程图(4分)

2. Experiment code (2 points)

3. Problems encountered in the debugging process of this question and solutions (4 points)

6-1 Calculate the sum and difference of two numbers

1. Design ideas (6 points)

 (1)主要描述题目算法(2分)。可以用文字描述(不允许使用伪代码),如:
     第一步:###
     第二步:###
      ......

  (2)流程图(4分)

2. Experiment code (2 points)

3. Problems encountered in the debugging process of this question and solutions (4 points)

6-1 Calculate the sum and difference of two numbers

1. Design ideas (6 points)

 (1)主要描述题目算法(2分)。可以用文字描述(不允许使用伪代码),如:
     第一步:###
     第二步:###
      ......

  (2)流程图(4分)

2. Experiment code (2 points)

3. Problems encountered in the debugging process of this question and solutions (4 points)

6-1 Calculate the sum and difference of two numbers

1. Design ideas (6 points)

 (1)主要描述题目算法(2分)。可以用文字描述(不允许使用伪代码),如:
     第一步:###
     第二步:###
      ......

  (2)流程图(4分)

2. Experiment code (2 points)

3. Problems encountered in the debugging process of this question and solutions (4 points)

Requirement 3. Learning summary and progress (15 points)
1. Summarize the knowledge points learned in the past two weeks and answer the following questions? (Express your understanding in your own words, no points for copying and pasting online) (5 points)

 (1)如何理解指针数组,它与指针、数组有何关系?为何可以用二级指针对指针数组进行操作?

 (2)将C高级第三次PTA作业(1)任何一个题目改为使用二级指针对指针数组进行操作。

 (3)用指针数组处理多个字符串有何优势?可以直接输入多个字符串给未初始化的指针数组吗?为什么?

2. Submit the source code of the PTA job to the hosting platform using git, and ask for a screenshot of the successful upload and your git address. Please note that the git address should be a string like "https://git.coding.net/Dawnfox/wf4_2.git" and a link that can be accessed directly by visitors . (3 points)

3. Comment on the homework of 3 classmates this week (give the link to the commented classmate's blog in the homework), and invite 3 classmates to comment on your homework, no homework (your homework has not been commented by 3 people) / or none Replying to comments from classmates or teachers will deduct points for this question. (4 points)

 建议采用汉堡包的方式点评其他同学的作业,只有赞扬没有给出实质性建议或者指正的不算点评,不给分。

4. Please use tables and line charts to present the number of lines of code and time spent this week (4/9 8:00~4/23 8:00), the number of blog words and time spent (3 points)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324445708&siteId=291194637