C-Bubbleソーティング
#include
#include
#include
void tri_a_bulle(int T[], int n)
{
int型温度;
ブールaucun_echange;
for(int i = n-1スパン>;i>=0スパン>;i--)
{
aucun_echange = true;
for(int j = 0スパン>;j<=i ;j++)
if(T[j] >T[j+1])
{
temp = T[d+1];
T[j+1]=T[j];
T[j]=temp;
aucun_echange = falseです。
}
if(aucun_echange == true)
ワゴン車;
}
}
int main()
{
int T[10]={5,2,9,7,1,6,12,51,24};
tri_a_bulle(T,10);
for (int i=0スパン>;私は<10スパン>;i++)
printf("%d ",T[i]);
return 0スパン>;
}