#include #include #include #include #include using namespace std; FILE* f; //char* filename; int year,a; class student { private: char name[25]; int age; public: void Nhap(char x[],int y) { strcpy(name,x); age=y; } void HienThi() { cout<<"Ten: "<>st>>a; mang[i].Nhap(st,a); } } filein.close(); return mang; } //===================================================================================================================// int InMang(student mang[]) { for(int i=0; i 0) { strcpy(tam.name,mang[i].name); strcpy(mang[i].name,mang[j].name); strcpy(mang[j].name,tam.name); tam.age=mang[i].age; mang[i].age=mang[j].age; mang[j].age=tam.age; } } ofstream fout("output1.txt",ios_base::out); { if(!fout.is_open()) { cout<<"ko mo duoc file"; } for(int i=0;imang[j].age) { strcpy(tam.name,mang[i].name); strcpy(mang[i].name,mang[j].name); strcpy(mang[j].name,tam.name); tam.age=mang[i].age; mang[i].age=mang[j].age; mang[j].age=tam.age; } } ofstream fout("output2.txt",ios_base::out); { if(!fout.is_open()) { cout<<"ko mo duoc file"; } for(int i=0;i>filename; docfile(filename); SapXep_Ten(mang); cout<