Array (Create, extract, bubble sort, and practice exercises)

Source: Internet
Author: User

An array is a combination of data of a data type. An entity in an array is called an element or member of an array.

Example one: creation and extraction of data

Example two: How to create and assign an array

Exercise One: Enter the age of nine people into an array from the console

Exercise two: Seeking the sum of ages

Exercise three: Seeking the sum of Ages, method two

Exercise Four: Enter the number of classes, according to the number of people to enter the results, to find the average score

Exercise five: Average score, highest score, lowest score

Exercise six: bubble sort, descending

Practice Seven: bubbling sort, ascending

Practice Eight: Enter 10 person's score, remove two highest score, two lowest score, calculate average score

Exercise Nine: Select Squad leader, vote for election

Exercise Ten: Generate seven non-repeating numbers

Exercise 11: Mobile number Lottery

Array (Create, extract, bubble sort, and practice exercises)

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.