void arrange_lksografi(char *string) //aranging the string by lksigrafi order
{
int i,j,letter_counter=0, maxIndex,temp;
for(i=0;string[i];i++)
letter_counter++;
for (i=1;i<letter_counter;i++)
{
maxIndex=0;
for (j=1;j<=letter_counter-i;j++) /* find max index */
if (string[j]>string[maxIndex])
maxIndex=j;
temp=string[letter_counter-i]; /* swap */
string[letter_counter-i]=string[maxIndex];
string[maxIndex]=temp;
}
printf("the sorted string:\n"); /* print sort array */
for (i=0;string[i]!;i++)
if(string[i]!=' ')printf("%c ", string[i]);
printf("\n");
}
תודה רבה מראש!!!!