#include <iostream>
#include <iomanip>
#include <conio.h>
#include <fstream>
//Using the standard namespace for files.
usingnamespace std;
//starting code for main program.
int main()
{
// Setting the variables.
int hold;
char inputchar = 'x';
double decimal[101] = {0};
char grid[101][13] = {0};
// Outputs a message on the screen.
cout << "Here are the special numbers in the range of 1-100 n";
// Loop to create the array of the numbers in decimal form.
for(int i = 1; i < 101; i++)
{
decimal[i] = 1./i;
}
// Inputs array into a text file
ofstream output("output.txt");
for(int i = 1;i < 101;i++)
{
output << fixed << setprecision(11); // Fix decimal places
output << decimal[i] << endl;
}
// Converts the text file into a 2D array
ifstream infile("output.txt");
for (int i = 1; i < 101; i++)
{
for (int j=0; j<13; j++)
{
infile >> inputchar;
grid[i][j] = inputchar;
}
}
// Displays the array
for (int i = 1; i < 101; i++)
{
for (int j=0;j<13;++j)
{
cout << grid[i][j];
}
cout << endl;
}
// Holds the screen up.
cin >> hold;
// Returns a value to end the code.
return(0);
}