How do I calculate the sum to below in C++? I tried the following code but failed.

#include <iostream>
using namespace std;
int main()
{
int n, p, r = -1;
cin >> n;
for (p = 0; p < 10; p++)
r *= (-1);
cout << r << endl;
return 0;
}
1*(10+1).-1 * upperLimit%2-1 + 1 -1 +1 -1 +1 ...