run results
#include
Using namespace STD.
//bubble sort, ascending
Int main ()
{
Int a [10], I, j, temp.
for(i=0; i<=9; I++)
{
Cin> A, [I].
}
cout
{
for(j=0; j{
If (a [j] & gt; A [m + 1])
{
Temp=a, [j].
A [j]=a, a + 1 bonus to [j].
+ I a [j]=temp;
}
}
cout
for(i=0; i<=9; I++)
{
cout}
}
CodePudding user response:
int main ()
{
Int a [10], I, j, temp.
for(i=0; i<10; I++)
{
Cin> A, [I].
}
coutfor(i=0; i<10; I++)
{
for(j=i+1; j<10; J++)
If (a [I] & gt; A [j])
{
Temp=a, [I].
A [I]=a, [j].
A [j]=temp;
}
}
for(i=0; i<10; I++)
{
cout}
return 0;
}
CodePudding user response: