Skip to content

Instantly share code, notes, and snippets.

@WIttyJudge
Last active September 30, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WIttyJudge/975fa35b085a6b0a18c7c0383087b628 to your computer and use it in GitHub Desktop.
Save WIttyJudge/975fa35b085a6b0a18c7c0383087b628 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main()
{
int rows; char fill; char stroke;
cout << "Select the number of rows: ";
cin >>rows;
cout << "Select the material to fill: ";
cin >>fill;
cout << "Select the material to stroke: ";
cin >> stroke;
cout << endl;
for (int j = 0; j <= rows; j++)
{
cout << " ";
}
cout << stroke << " ";
for (int j = 1; j <= rows * 2 + 3 ; j++)
{
cout << stroke;
}
cout << "\n";
for (int i = 1; i <= rows; i++)
{
for (int j = 0; j < 1 + rows - i; j++)
{
cout << " ";}
cout << stroke;
for (int j = 0; j < i * 2 - 1; j++)
{
cout << fill;
}
cout << stroke;
cout << " ";
cout<< " "<< stroke;
for (int j = 0; j < (rows * 2 + 1) - (i * 2); j++)
{
cout << fill;
}
cout << stroke;
cout << endl;
}
for (int j = 0; j < 3 + rows * 2; j++)
{
cout << stroke;
}
cout << " " << stroke;
cout << "\n\n\n";
system("pause");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment