Advertisement
Andr3i02

Untitled

Nov 19th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. 6.
  2. #include<iostream>
  3. #include<cstring>
  4. using namespace std;
  5. char x[256];
  6. int main()
  7. {
  8. int i,s=0;
  9. cin.getline(x,256);
  10. for(i=0;i<=strlen(x);i++)
  11. {
  12. if(x[i]>='0'&&x[i]<='9')
  13. {
  14. s=s+x[i]-48;
  15. }
  16. }
  17. cout<<s;
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement