#include<iostream>
#include<string>
#include<sstream>
using namespace std;
int main() {
string line;
while(getline(cin,line)){
int sum=0,x;
cout<<line<<endl;
stringstream ss(line);//创建输入流
while(ss>>x)sum+=x;
cout << sum << endl;
}
return 0;
}
string 和 sstream 都很方便但是很慢要谨用;