This is not a simple formula that you can plug into your program, but rather an infinite series. (To be honest, I don't understand the notation your teacher gave you.) You can't make a calculation with an infinite number of elements, but with a computer, you can easily carry this series out to 100 or 100,000 elements.
Here is a reference.
The series is equal to one-quarter of PI, and it looks like this:
1 - 1/3 + 1/5 - 1/7 + 1/9 -1/13 +1/17...
Can you see what's next? ...-1/19 +1/21 -1/23...
You need to write a loop does this automatically for 100, 1,000 or 100,000 elements. Each time you go through the loop, you will be adding-and-subtracting smaller-and-smaller fractions. In other words, your program will be figuring-out the fractions... For example, you won't see "1\13" or any of those fractions anywhere in your C++ code... You might see "1/i". Does that make sense?
I assume you know how to write a loop that increments a number, or adds 5 to a number every time through the loop... If you don't know how to do that, you need to re-study loops before you jump into this project.