SHARE
TWEET

siruri pb6

Alex_Fuleki21 Nov 19th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. char a[100];
  5. int main()
  6. {
  7.     int n,i,s;
  8.     s=0;
  9.     cin.getline(a,100)
  10.     cin>>a;
  11.     cin>>n;
  12.     n=strlen(a)-1;
  13.     for(i=0;i<=n;i--)
  14.     {
  15.         if(a[i]>='0'&&a[i]<='9')
  16.         {
  17.             s=s+a[i];
  18.         }
  19.     }
  20.     cout<<s;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top