Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 6.
- #include<iostream>
- #include<cstring>
- using namespace std;
- char x[256];
- int main()
- {
- int i,s=0;
- cin.getline(x,256);
- for(i=0;i<=strlen(x);i++)
- {
- if(x[i]>='0'&&x[i]<='9')
- {
- s=s+x[i]-48;
- }
- }
- cout<<s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement