1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <fstream>
#include <iostream>
#include <string>
#include <string.h>
#include <valarray>
#include <cstdlib>
#include <iomanip>
using namespace std;
using matrix = valarray< valarray<double> >;
matrix table={ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}};
int main()
{
std::fstream myFile;
myFile.open("table.txt", ios_base::in|ios_base::out|ios_base::trunc);
if (myFile.is_open())
{
std::cout <<"File open successful" <<endl;
myFile << table <<endl;
myFile.close();
}
return 0;
}
|