Khác biệt giữa bản sửa đổi của “Sắp xếp nổi bọt”

Nội dung được xóa Nội dung được thêm vào
n Đã lùi lại sửa đổi của Nguyenlehai (Thảo luận) quay về phiên bản cuối của 113.190.233.103
Dòng 87:
if(unsortedArray[index] > unsortedArray[index+1]) { //Test if need a swap or not.
temp = unsortedArray[index]; //These three lines just swap the two elements:
unsortedArray[index] = unsortedArray[indexunsortedex+1];
unsortedArray[index+1] = temp;
}
Dòng 103:
cout<<"nhap so phan tu cua mang n:";
cin>>n;
for(int i=0; i<n; i++) {
cout<<"phan tu A["<<i<<"]"<<"=";
cin>>A[i];