#include <iostream>
using namespace std;
int main()
{
double x;
double sum = 0;
while (cin>>x,x) //添加逗号运算符。因为cin返回值始终为1,直到遇见文件结束符ctrl+z
{
sum = sum + x;
cout << "Now, sum = " << sum << endl;
}
cout << "Input 0, Warnnig.......\nTerminated!";
cin.get();
cin.get();
return 0;
}