School job FAST HELP!

Hello!
So im noob at this c++ stuff and i need to program output like this:

Write number:
-2 // im writing number in Runing program
Write number:
1
Write number:
-1
Write number:
12
Write number:
0
SUM of positive numbers: 13
SUM of negative numbers: -3
Please note that this is not a homework site. We won't do your homework for you. The purpose of homework is that you learn by doing. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.

We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again.
The code might be a bit advanced, you can choose to adapt the code to your needs, or come to me to ask questions.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <cstdio>
#include <cstdlib>

int main()
{
	int sum_p = 0;
	int sum_n = 0;
	int x = -1;
	while(x != 0)
	{
		std::cout << "- Write number : ";  
		if(std::cin >> x && x != 0)
		{
			(x >= 0) ? (sum_p += x) : (sum_n += x);
		}
		else if(!std::cin && ((std::cin.clear(), std::cin.ignore(1000, '\n')), x = -1))
		{
			std::cout << "Invalid value\n\n"; 
		}
	}

	std::cout << "SUM of positive numbers : " << sum_p << std::endl; 
	std::cout << "SUM of negative numbers : " << sum_n << std::endl; 

	system("pause");
	return 0;
}


- Write number : -1
- Write number : 1
- Write number : -1
- Write number : 12
- Write number : 0
SUM of positive numbers : 13
SUM of positive numbers : -2
Topic archived. No new replies allowed.