#include <iostream>
#include <fstream>

int main(){

        //Initialize _ofs as an object of class ofstream
	std::ofstream _ofs;

	//Open up the file hist.dat
	_ofs.open("hist.dat", std::ios::out);

	//Write to the file hist.dat
	_ofs << "Hello, World!" << std::endl;

	_ofs.close();

	 //Open up the file hist.dat
        _ofs.open("hist.dat", std::ios::app);
                                                                                
        //Write to the file hist.dat
        _ofs << "Hello, World!" << std::endl;
                                                                                
        _ofs.close();

	  //Open up the file hist.dat
        _ofs.open("hist.dat", std::ios::app);
                                                                                
        //Write to the file hist.dat
        _ofs << "Hello, World!" << std::endl;
                                                                                
        _ofs.close();

}
