U E D R , A S I H C RSS

새싹교실/2017/내무반/한윤진/BubbleSort (rev. 1.1)

새싹교실/2017/내무반/한윤진/Bubble Sort


void bubbleSort(int A[], int N);

int main()
{
int i;
int a5;
for(int j=0;j<5;j++){
scanf("%d",&aj);
}
bubbleSort(a,5);
for (i=0;i<5;i++)
printf(“%d\n”,ai);

return 0;
}
void bubbleSort(int A[], int N)
{
int temp,i, j;
for (i=N-1;i>=1;i--)
for (j=1;j<=i;j++)
if (Aj-1>Aj) {
temp=Aj-1;
Aj-1=Aj;
Aj=temp;
}
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:07
Processing time 0.0200 sec