Data structure exp1_1 (selection sort)

Table of contents

Data structure exp1_1 (selection sort) 

programming

program analysis 


 

Data structure exp1_1 (selection sort) 

[Problem description] For an array containing n integers, use selection sort to sort them from small to large.
[Input form] The first line contains the number of elements n, and the second line contains n integers (separated by spaces).
[Output format] Output n integers (separated by spaces)
[Sample input]

43 2 56 1 22 9
[Sample output]
1 2 9 22 43 56

programming

C language

#include<stdio.h>
int main(){
    int n,i,j,t,a[10000],min;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    

Guess you like

Origin blog.csdn.net/m0_68111267/article/details/130034058