Single inheritance C++ program pattern like a pyramid repeat

Write a program in C++ to make such a pattern like a pyramid with a number that will repeat the number in the same row using a single inheritance in OOP.

Print pyramid pattern using do while loop c++