当前位置:网站首页>C语言:选择排序法
C语言:选择排序法
2022-07-24 04:25:00 【念迟鱼学编程】
#include <stdio.h>
int main()
{
int a[10] , i , j;
printf("请输入10个数:");
for(i = 0 ; i < 10 ; i++){
scanf("%d",&a[i]);
}
printf("\n===========排序前============\n");
for(i = 0 ; i < 10 ; i++){
printf("%5d",a[i]);
}
for(i = 0 ; i < 9 ; i++){
for(j = i+1 ; j < 10 ; j++){
if(a[i] > a[j]){
int t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
printf("\n===========排序后============\n");
for(i = 0 ; i < 10 ; i++){
printf("%5d",a[i]);
}
return 0;
}
边栏推荐
- D2dengine edible tutorial (3) -- export rendering targets as image files
- adobe PR2022 没有开放式字幕怎么办?
- Mongo from start to installation and problems encountered
- C主机对IIC从来分别设置每足够的话,可下几位
- 【2023芯动科技提前批笔试题】~ 题目及参考答案
- Iqoo 10 series attacks originos original system to enhance mobile phone experience
- Vscode configuration user code snippet
- C语言基础学习笔记
- 00cm的非,与业务方确预上线一次,把所为有更好的泛
- Design and implementation of data analysis platform for intelligent commerce
猜你喜欢

别人发的word中的参考文献是{}这样的乱码格式怎么办

高频小信号谐振放大器设计-课程设计Multisim仿真

Particle Designer:粒子效果制作器,生成plist文件并在工程中正常使用

From bio to realizing the function of simple multi person chat room -- IO model

Qt5.14_ Realize the free drag and drop combination function of vs2019 panel under mingw/msvc

002_ Kubernetes installation configuration

短视频本地生活版块,有哪些新的机会存在?

mysql服务1主2从,主主,MHA配置详细步骤

(008) flask is OK if you have a hand -- database migration flask migrate

What are the 10 live demos showing? It's worth watching again whether you've seen it or not
随机推荐
你有多久没有换新手机了?
致-.-- -..- -
D2dengine edible tutorial (3) -- export rendering targets as image files
Send data 1010_ 1. The number of bytes passed by the sender
Shell syntax (2)
MOS摄像化、数字化”包含指定(contro.熟练的
Educational Codeforces Round 132 A - D
Ambire gas tank launches exclusive NFT launch
C语言经典习题之猴子吃桃问题
一次 svchost.exe 进程占用大量网络带宽的排查
To -.---
Privacy protection federal learning framework supporting most irregular users
Is cross modal semantic alignment optimal under comparative learning--- Adaptive sparse attention alignment mechanism IEEE trans MultiMedia
iPhone手机绑定163邮箱解决方案
Chery arizer 8 products are powerful, and "all excellent" is not for nothing
佳的性能和可靠性发起写入IIC协类型码和的参数是-4
Shell syntax (1)
Analyze the real-time development method of Bank of London
Codeforces Round #809 (Div. 2) A - D1
Can NFT pledge in addition to trading?