当前位置:网站首页>C language: selective sorting method
C language: selective sorting method
2022-07-24 04:29:00 【Nianchi ichthyology programming】
#include <stdio.h>
int main()
{
int a[10] , i , j;
printf(" Please enter 10 Number :");
for(i = 0 ; i < 10 ; i++){
scanf("%d",&a[i]);
}
printf("\n=========== Before ordering ============\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=========== After ordering ============\n");
for(i = 0 ; i < 10 ; i++){
printf("%5d",a[i]);
}
return 0;
}
边栏推荐
- Ship test / IMO a.799 (19) incombustibility test of marine structural materials
- Parallel technology of Oracle
- Iqoo 10 series attacks originos original system to enhance mobile phone experience
- PostgreSQL guide -- inside exploration Chapter 1 database clusters, databases and data tables
- Redis sentinel mode, master node check script
- C语言经典练习题
- BGP notes (II)
- [2023 core technology approval test questions in advance] ~ questions and reference answers
- Smart contract: release an erc20 token
- Design and implementation of data analysis platform for intelligent commerce
猜你喜欢

Chery arizer 8 products are powerful, and "all excellent" is not for nothing

(零八)Flask有手就行——数据库迁移Flask-Migrate

仿今日头条实时新闻微信小程序项目源码

Billiard simulator based on the integration of GL pipeline and ray tracing technology

Jinglianwen technology provides 3D point cloud image annotation service

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

基于GL Pipeline与光线追踪技术的融合实现的台球模拟器

buu web
【望解答】数据无法正确同步了

微波技术基础实验二 功分器与定向耦合器设计
随机推荐
How did I get four offers in a week?
Ambire wallet opens twitter spaces series
[translation] announce krius -- accelerate your monitoring and adoption of kubernetes
仿今日头条实时新闻微信小程序项目源码
[09] program loading: "640K memory" is really not enough?
buu web
C语言基础学习笔记
adobe PR2022 没有开放式字幕怎么办?
Merge sort
C language classic exercises to write a program to find all the perfects within 1000.
Gau and ppm for image semantic segmentation
(零八)Flask有手就行——数据库迁移Flask-Migrate
【2023芯动科技提前批笔试题】~ 题目及参考答案
How long has it been since you changed your cell phone?
Live classroom system 04 create service module
Good performance and reliability. The parameter that initiates writing IIC co type code and is -4
Where is the difficulty in attracting investment in the park? Inventory of difficulties and difficulties in attracting investment in industrial parks
Alibaba Taobao Department interview question: how does redis realize inventory deduction and prevent oversold?
[untitled]
Billiard simulator based on the integration of GL pipeline and ray tracing technology