As has been suggested several times, a graphical output would look much better and represent the proportions much better. In C++ this could look like this with GDI+:
void MyDraw1(HDC hdc, int start_x, int start_y, double size)
{
using namespace Gdiplus;
Graphics gfx(hdc);
std::vector<Point> p;
p.push_back(Point(0, 0));
p.push_back(Point(0, 3));
p.push_back(Point(4, 3));
for (size_t i = 0; i < p.size(); i++) {
p[i].X = (INT)round(p[i].X * size) + start_x;
p[i].Y = (INT)round(p[i].Y * size) + start_y;
}
Color mycolor(0, 0, 255);
Pen myPen(mycolor);
gfx.DrawPolygon(&myPen, p.data(), p.size());
}
If the triangular shape has to be realized with the character * instead of a line, that is of course also possible. You would then have to calculate the exact position for each *.