Created
September 5, 2017 13:13
-
-
Save myusufid/02d0d83a6fbb2631c1b2fe8e72ec72dc 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 <iostream> | |
using namespace std; | |
int main() | |
{ | |
int i,k,temp; | |
int nim[]={1,5,0,2,8,1,4,9}; | |
for(i=0;i<=7;i++) | |
{ | |
cout<<nim[i]; | |
} | |
cout<<endl; | |
for(i=0;i<=7;i++) | |
{ | |
for(k=0;k<=7;k++) | |
{ | |
if(nim[k]>=nim[k+1]) | |
{ | |
temp = nim[k]; | |
nim[k] = nim[k+1]; | |
nim[k+1] = temp; | |
} | |
} | |
} | |
for(i=0;i<=7;i++) | |
{ | |
cout<<nim[i]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment