Last active
May 23, 2018 23:53
-
-
Save gollilla/dbc6d270c38c86fae6444cb34db6f5c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void){ | |
// Your code here! | |
int data[] = {9, 14, 6, 42, 24, 7, 12}; | |
int i,j,tmp,min; | |
for(i=0;i<=6;i++){ | |
min = i; | |
for(j=i;j<=6;j++){ | |
if(data[j] < data[min]){ | |
min = j; | |
} | |
} | |
tmp = data[i]; | |
data[i] = data[min]; | |
data[min] = tmp; | |
} | |
for(i=0;i<=6;i++){ | |
printf("%d\n", data[i]); | |
} | |
} | |
//https://paiza.io/projects/wmI8E-mAhPqSDrigjjvGWw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment