#include <iostream>
#include <sstream>
#include <stdlib.h>

using namespace std;

float numb; float sum=0;

int main()
{
    cout << "This app calculates the sum of all entered numbers." << endl;
    cout << "To stop the program, enter 0." << endl << endl;
    cout << "Enter the first number: ";
    
    string input;  
 
    while(cin >> input)
    {
    	stringstream sst(input); 
    	if (sst>>numb) {
	        sum += numb;

            cout << "Sum equals: " << sum << endl << endl;

        	if (numb==0)
        	{
            	cout << "Entered 0." << endl;
            	break;  // exits the while loop 
        	}
        	cout << "Enter another number: ";
    	}
    	else 
    	{
    		cout << "Ignored entry "<<input<<endl; 
    	}
    }
    cout << "Press Enter to terminate the app." << endl;
    return 0;
}