Skip to content

Instantly share code, notes, and snippets.

@myusufid
Created September 5, 2017 13:13
Show Gist options
  • Save myusufid/02d0d83a6fbb2631c1b2fe8e72ec72dc to your computer and use it in GitHub Desktop.
Save myusufid/02d0d83a6fbb2631c1b2fe8e72ec72dc to your computer and use it in GitHub Desktop.
#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