Home > Back-end >  Write a function, use the "method of bubble" 10 characters to input from small to large or
Write a function, use the "method of bubble" 10 characters to input from small to large or

Time:09-23

# include "stdafx. H"

Int main (int arg c, char * argv [])
{
Char rank (char a, char b);
Char a [10], [10] b;
Printf (" do enter ten character! \n");//character is character
The scanf (" % s ", a);
for(int i=0; i<9. I++)
{
B (b [I], [I + 1))=rank (a [I], a [I + 1));//is rank order
}
for(int j=0; j<10; J++)
Printf (" % c "[j]. B);
printf("\n");
return 0;
}
Char rank (char a, char b)
{
char c;
If (a> B)
{
C=a;
a=b;
b=c;
}
Return (a, b);
}



syntax that's right but I don't know why the assignment and I think not the same as

CodePudding user response:

The building Lord your rank function can return a char, doesn't return a set

CodePudding user response:

That, in the return of rank equivalent to an operator, no effect, only behind returns that value

CodePudding user response:

Your function can't complete the sorting?
  • Related