#include
#include
#include
using namespace std;
bool IsAllInt(string str);
int main()
{
string input;
while(getline(cin,input))
{
int sum=0;
stringstream stream(input);
while(stream)
{
string word;
stream>>word;
if(IsAllInt(word))
{
sum += atoi(word.c_str());
}
}
cout<}
return 0;
}
bool IsAllInt(string str)
{
for(int i=0;i{
if(!isdigit(str[i]))
return 0;
}
return 1;
}
No comments:
Post a Comment