06.12.2009, 15:27
sombody have an idia how can i find the biggest 10 numbers in an array?
TNX for the help =]
TNX for the help =]
Originally Posted by Щә яә Ґя
Lol , the first ten biggest numbers ? Are you kidding ?
|
bubbleSort(array[], length)
{
new i,j;
for(i=0;i<length;i++)
{
for(j=0;j<i;j++)
{
if(array[i]>array[j])
{
new temp=array[i]; //swap
array[i]=array[j];
array[j]=temp;
}
}
}
}
new array2[] = {1, 5, 3, 7, 5, 3, 2};
bubbleSort(array2, 7);
for(new i = 0; i < 7; i++)
{
printf("%d",array2[i]);
}