Created
March 8, 2012 21:04
-
-
Save ErisianArchitect/2003444 to your computer and use it in GitHub Desktop.
sort
This file contains hidden or 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
int arr[5]; | |
int input = 0; | |
arr[0] = INT_MAX; | |
arr[1] = INT_MAX; | |
arr[2] = INT_MAX; | |
arr[3] = INT_MAX; | |
arr[4] = INT_MAX; | |
for(int i = 0; i < 5; i++) | |
{ | |
cin >> input; | |
for(int n = 0; n < 5; n++) | |
{ | |
if(input < arr[n]) | |
{ | |
Insert<int>(arr,n,5,input); | |
break; | |
} | |
} | |
} | |
for(int i = 0; i < 5; i++) | |
{ | |
cout << arr[i] << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment