#include #include #include #include using namespace std; int main() { char outfile_name[81]; float x; ofstream outfile; cout << "Enter the name of the file.\n"; cin >> outfile_name; cout << "\n"; outfile.open( outfile_name ); if ( outfile.fail() ) { cout << "The file `" << outfile_name << "' could not be opened.\n"; system( "PAUSE" ); exit( EXIT_FAILURE ); } cout << "Enter five numbers, " << "each followed by a carriage return.\n"; outfile.setf( ios::scientific ); outfile.setf( ios::right ); outfile.precision( 5 ); for ( short i = 1; i <= 5; i++ ) { cin >> x; outfile << setw(13) << x << "\n"; } cout << "\n\n"; system( "PAUSE" ); return( EXIT_SUCCESS ); }