i have this problem:



Write a fragment of code that reads in a header value from the standard input and then reads in that many integers (also from standard input) and prints their sum to standard output (for loops, header values, accumulators, basic arithmetic). Declare any variables you use.

and this is my code:

int num, num2, num3;
cin >> num;
num2 = 0;
for(int i = 0; i < num; i++)
{
cin >> num3;
num2 += num3;
cout << num2;
}

but it keeps saying "Unexpected identifiers: num2, num3".

what should i change.