#include "stdio.h"
#include "string.h"
void MaoPao(int* s, int num);
int main()
{
int buf[] = { 1,23,12,11,32,12,123,15 };
int bufNum = sizeof(buf) / sizeof(int);
MaoPao(buf, bufNum);
for (int i = 0; i < bufNum; i++)
{
printf("%d,",buf[i]);
}
}
void MaoPao(int* s,int num)
{
for (int i = 0; i < num; i++)
{
for (int j = i; j < num; j++)
{
if (s[i] < s[j])
{
s[i] ^= s[j];
s[j] ^= s[i];
s[i] ^= s[j];
}
}
}
}
相关文章
- 02-14C语言内存管理详解
- 02-14大一下C语言
- 02-14C 语言结构体之点运算符( . )和箭头运算符( -> )的区别
- 02-14【应用C】C语言模拟虚拟内存基本页面置换算法FIFO、OPT和LRU并比较效率(+源代码)
- 02-14冒泡排序(BubbleSort)
- 02-14冒泡法排序
- 02-14冒泡排序
- 02-14冒泡排序
- 02-14排序——冒泡排序BubbleSort
- 02-14排序-冒泡排序