Lab 11: Pointers (2)

Source: Internet
Author: User

first, the contents of the experiment

1. Bubble method to sort. a custom Function implementation is required to simply sort the array of integers using bubbling method. function Interface Definition:

void int int n);

which a is the array to be sorted, N is an array a the number of elements in the The function uses the bubbling method to sort the elements in array a in ascending order, and the result is still in array a .

write the main function, and call the function in it Sort (), try to write the corresponding program.

2. find the specified element in the array : requires a custom function

int int int int x);

whichlist[]is the user's incoming array;N(n>0) islist[]the number of elements in the element;xis the element to be found. If found, the functionSearchreturns the minimum subscript for the corresponding element (the subscript starts at 0), otherwise returns? 1.

Write the main function and call function Search() in it. Try to write the appropriate program.

3. Number of games: There are n people around in a circle, in order from 1 to n -numbered. From the first person began to count, reporting m(<n) of the people out of the circle; the next person starts off in 1, and the person reporting m exits the circle. So go on until the last person left. Enter integers n and m, and output the number of people exiting the circle in exit order. The subject requires a custom function

void int int int  out [] );

where n is the initial number,M is the game's prescribed exit precedence (guaranteed to be a positive integer less than n ). The function Countoff The exit order number of each person into the array out[] .

Write the main function and call the function Countoff() in it. Try to write the appropriate program.

Experimental Requirements:

1. The experimental code can be published directly to the blog, or according to the requirements of the TA teacher to upload to coding.

2. Publish an essay, summarize the knowledge points involved in this experiment, and summarize the problems encountered in this experiment and solutions, as well as some experience.

Knowledge Points:

(1) .....

(2) .....

...........

The problems encountered during the experiment and the solutions:

(1) .....

(2) .....

...........

Experience of experimental experiences

.........

Second, the predecessor work

Scan the two-dimensional code on the book, combined with the video preview eighth Chapter 8.4 and Nineth chapter of the structure of the content.

Third, additional questions (3): Complete the textbook P92 programming design question 6th to the 10th question

Additional questions are chosen to do the topic, if you think your previous grades are not ideal, want to make up for the students can consciously complete, but must do their own. Additional questions require a separate essay, in the following format: (10 points for this additional assignment)

Title: Additional Assignments 4

Content: 1. Job Title

Code: (Note the need to use the code format provided by the blog Park)

Test:

2. Job Title

Code: (Note the need to use the code format provided by the blog Park)

Test:

......

Summary: This summary requires to give the experimental process encountered problems, solutions, and experience and so on.

the deadline for this assignment is 7 months , noon and a half .

Lab 11: Pointers (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.