virtual base class C++ Program pattern like right angle triangle with a number

Write a program in C++ to make such a pattern like right angle triangle with a number which will repeat a number in a row by using the virtual base class in object oriented programming.