Tìm và sửa lỗi chương trình (tt)
Giả sử đã có hàm HoanVi, và hàm InMang
void GhiFile(ofstream &file, int a[], int n){
//Mo file de ghi
file.open("output.txt");
//Xu ly chuong trinh
for(int i=0;i<>
for(int j=i+1;j<>
if(a[i]>a[j]){
HoanVi(a[i],a[j]);
}
}
}
cout<<"\nMang sau khi sap xep\n";
InMang(a,n);
//Tien hanh ghi file
file<
file<<"\n";//Xuong dong trong file
for(int i=0;i
file<<>
}
//Dong file
file.close();
}