SHARE
TWEET

Untitled

Pop_Paul0 Nov 18th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     long long x,c,p=1,r=0;
  6.     cin>>x;
  7.     do
  8.     {
  9.         c=x%10;
  10.         if(c%3==0)
  11.         {
  12.             r=r+c*p;
  13.             p=p*10;
  14.         }
  15.  
  16.  
  17.         x=x/10;
  18.     }
  19.     while(x!=0);
  20.     cout<<r;
  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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top