当前位置:网站首页>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,
边栏推荐
- Learning multi-level structural information for small organ segmentation
- Detectron: train your own data set -- convert your own data format to coco format
- 运算符<< >>傻瓜式测试用例
- Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
- How to use multithreading to export excel under massive data? Source code attached!
- QT releases multilingual International Translation
- 注释与注解
- 746. Climb stairs with minimum cost
- How to solve the component conflicts caused by scrollbars in GridView
- C réaliser des jeux de serpents gourmands
猜你喜欢
JSON Web Token----JWT和傳統session登錄認證對比
【无标题】
测试岗的中年危机该如何选择?是坚守还是另寻出路?且看下文
Impact relay jc-7/11/dc110v
树形dp
Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout
Arcpy 利用updatelayer函数改变图层的符号系统
C语言练习题(递归)
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
AWT常用组件、FileDialog文件选择框
随机推荐
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
4G wireless all network solar hydrological equipment power monitoring system bms110
Bicolor case
Compound nonlinear feedback control (2)
24 magicaccessorimpl can access the debugging of all methods
分布式CAP理论
SQL join, left join, right join usage
High performance parallel programming and optimization | lesson 02 homework at home
2022.7.3-----leetcode.556
实用的小工具指令
JS arguments parameter usage and explanation
JS execution mechanism
C实现贪吃蛇小游戏
安装 Pytorch geometric
如何避免 JVM 内存泄漏?
Leakage detection relay jy82-2p
Component、Container容器常用API详解:Frame、Panel、ScrollPane
Configure cross compilation tool chain and environment variables
Fast power (template)
Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout