You are on page 1of 3

//Chloe Sebring

// Homework 5
#include <iostream>
#include <fstream>
using namespace std;
ofstream fout;

void line(char ch, int num)


{
int i;
for (i = 0; i < num; i++)
{
fout << ch;
}
fout << endl;
}

void rectangle(char ch, int x, int y)


{
int z = 0;
while (z < y)
{
line(ch, x);
fout << endl;
z++;
}

}
void main()
{
fout.open("Letters.dot");
int Y = 0;
int X = 0;
int in = 65;
ifstream fin;
char ch;
int place;
fin.open("Animals.dat");
fin.get(ch);
while (!fin.eof())
{

if (ch == '\n') // enter stroke


{
Y = 0;
fout << endl<< endl << endl<<endl;

}
else

{
Y++;
X = ch - 'A' + 1;
rectangle(ch, X, Y);
fout << endl;
}
fin.get(ch);

}
}

You might also like