当前位置:网站首页>The sorting in C language realizes the number sorting method from small to large
The sorting in C language realizes the number sorting method from small to large
2022-07-04 06:23:00 【Tears like eating hot pot】
Abstract : For project development , Sometimes I want to be right ADC Sort the collected voltage , And then come to a stable ADC value , Sorting is essential .
get_value[10] = {23,10,9,75,22,33,0,8,6,20};
int main(void)
{
for (uint8_t i = 1; i < 10; i ++)
{
for (uint8_t j = 0; j < 10 - i; j ++)
{
if (get_value[j] > get_value[j + 1])
{
tmp = get_value[j];
get_value[j] = get_value[j + 1];
get_value[j + 1] = tmp;
}
}
}for(uint8_t i = 0;i<10;i++)
{
printf("get_value[%d] = %d ,",i,get_value[i]);
}
}
result :
0,6,8,9,10,20,22,23,33,75,
边栏推荐
- 70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
- AWT常用组件、FileDialog文件选择框
- Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout
- AWT介绍
- 雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
- How to get the parent node of all nodes in El tree
- 如何避免 JVM 内存泄漏?
- Appium foundation - appium installation (II)
- Nexus 6p从8.0降级6.0+root
- JS execution mechanism
猜你喜欢
![[untitled]](/img/32/cfd45bb5e8555ea2ad344161370dbe.png)
[untitled]

JS arguments parameter usage and explanation

Leakage detection relay jy82-2p

27-31. Dependency transitivity, principle

Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs

Leetcode question brushing record | 206_ Reverse linked list

gslb(global server load balance)技术的一点理解

Abap:ooalv realizes the function of adding, deleting, modifying and checking

JSON web token -- comparison between JWT and traditional session login authentication

C实现贪吃蛇小游戏
随机推荐
MySQL的information_schema数据库
SQL injection SQL lab 11~22
ABAP:OOALV实现增删改查功能
509. 斐波那契数、爬楼梯所有路径、爬楼梯最小花费
Appium基础 — APPium安装(二)
Inputstream/outputstream (input and output of file)
对List进行排序工具类,可以对字符串排序
QT 获取随机颜色值设置label背景色 代码
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
QT QTableWidget 表格列置顶需求的思路和代码
剑指 Offer II 038. 每日温度
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
注释与注解
Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout
手动对list进行分页(参数list ,当前页,页面大小)
How to help others effectively
如何实现视频平台会员多账号登录
Dimension and format of data
C language exercises (recursion)