With this C++ code you can know how many polygon there is in your "n" ribs diagonal.
All you need to insert is "n" - the numbers of the diagonal ribs.
We can see that to calculate the numbers of polygon we use this formula:
Diagonals = 0.5 * n * (n - 3)
I was in an interview, where they asked me "How many Diagonals does Octagon have?"
I remembered the function and decided to build a little program that calculates how many diagonals any size of polygon have.