分享兴趣,传播快乐,增长见闻,留下美好!
亲爱的您,这里是LearningYard新学苑。
今天小编为大家带来“深入C++(一)——一维数组”,欢迎您的访问。
Share interest, spread happiness, increase knowledge, and leave beautiful.
Dear, this is the LearingYard Academy!
Today, In-depth C++ (I) - One-dimensional arrays,welcome to visit!
一、一维数组
1. One-dimensional arrays
数组,一个里面放着相同类型元素的集合。一维数组,用以组织具有一维顺序关系的一组同类型的数据。数组有两个特点,元素同类型和地址连续。
An array, a collection of elements of the same type. A one-dimensional array for organizing a set of data of the same type with a one-dimensional sequential relationship. Arrays have two characteristics, the elements of the same type and address consecutive.
二、五只小猪
2. Five little pigs
已知五只小猪的体重,找出体重最重的那只小猪。五只小猪的体重用一维数组表示,通过索引依次判断体重大小,获得最重小猪的重量和编号。
Given the weight of the five piglets, find the heaviest one. The weight of the five piglets was represented by a one-dimensional array, and the weight and number of the heaviest piglet were determined by the index in turn.
三、逆序
3. Reverse order
前后对称交换,实现逆序。
Symmetric exchange before and after to achieve reverse order.
四、冒泡排序法
4. Bubble sort method
冒泡排序,顾名思义,数大的往后沉,数小的往前冒,最终实现从小到大的排序。
Bubbling sort, as the name suggests, the number of large sink back, the number of small rise forward, and finally achieve the sort from small to large.
今天的分享就到这里了,
如果您对文章有独特的想法,
欢迎给我们留言。
让我们相约明天,
祝您今天过得开心快乐!
That's all for today's sharing.
If you have a unique idea about the article,
please leave us a message,
and let us meet tomorrow.
I wish you a nice day!
翻译:网易有道翻译
本文由LearningYard学苑整理并发出,如有侵权请后台留言沟通.
文案|Dongyang
排版|Dongyang
审核|hong
Learning Yard 新学苑