SHARE
TWEET

1.a (stegerea c>5)

cupsamada Nov 18th, 2019 79 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.     int n, c, rez=0, p=1;
  6.     cin>>n;
  7.     do
  8.     {
  9.         c=n%10;
  10.         if(c<=5)
  11.         {
  12.             rez=rez+c*p;
  13.             p=p*10;
  14.         }
  15.         n=n/10;
  16.     }while(n!=0);
  17.     cout<<rez;
  18.     return 0;
  19. }
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