Code này sai ở chỗ não vậy? Sắp xếp dãy theo thứ tự tăng dần, đọc dữ liệu từ File. In:n=5, a[ ] 3 2 4 5 1. Out: n=5, a[ ] 1 2 3 4 5.
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <conio.h>
using namespace std;
void doctep( float a[], int &n)
{
fstream fdoc("data.txt",ios::in);
fdoc >> n;
for (int i=0;i<n;i++)
fdoc >> a[i];
fdoc.close();
}
void doicho(float x, float y)
{
float temp;
if (x>y)
{
temp=x;
x=y;
y=temp;
}
}
void selectsort(float a[], int n)
{
int Min;
for (int i=0;i<n-1;i++)
{
for (int j=i+1; j<n; j++)
{
if(a[j]<a[Min])
{
Min=j;
doicho(a[Min],a[j]);
}
}
}
}
void ghitep(float a[], int &n)
{
fstream fghi("ketqua.txt",ios::out);
fghi << " n = " << n << endl;
for (int i=0;i<n;i++)
fghi << a[i];
fghi.close();
}
main()
{
int n;
float a[10],x,y;
doctep(a,n);
selectsort(a,n);
doicho(x,y);
ghitep(a,n);
}
chứ bạn chỉ post code thế này mọi người không có thời gian kiểm tra hết toàn bộ code cho bạn đâu 
mà giờ thấy ref dễ hơn nên chuyển qua ref
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?