Simple input problem

#include
#include
using namespace std;

int main() {
std::vectora;
int b;
std::cin >> b;
while(std::cin)
{
a.push_back(b);
std::cin >> b;
}
int sum = 0;

for(std::vector<int>::size_type i = 0; i != a.size(); i++) {
    sum = sum + a[i];
    
    while(sum>=0){
      sum++;
      
    }
    if(sum<0) break;

}
cout<<sum<<endl;

return 0;

}
please tell me what i am doing wrong in this code

@graftyexplode97 Please save your code on ide.codingblocks.com and share its link.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.