document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2. using namespace std;
  3. #include <sstream>
  4.  
  5. bool isAllDigit(string inword);
  6.  
  7. int main ()
  8. {
  9. string input;
  10.  
  11. while(getline(cin,input))
  12. {
  13. int sum=0;
  14. stringstream wholeline(input);
  15.  
  16. while(wholeline)
  17. {
  18. string word;
  19.  
  20. wholeline >> word;
  21.  
  22. if(isAllDigit(word))
  23. {
  24. sum += atoi(word.c_str());
  25. }
  26. }
  27.  
  28. cout<<sum<<endl;
  29.  
  30.  
  31. }
  32.  
  33.  
  34. return 0;
  35. }
  36.  
  37.  
  38. bool isAllDigit(string inword)
  39. {
  40. bool alldigit=1;
  41. for(int i=0;i<inword.length();i++)
  42. {
  43. if(!isdigit(inword[i]))
  44. {
  45. alldigit=0;
  46. break;
  47. }
  48. }
  49. return alldigit;
  50. }
');