Advertisement
Dizzy3113

Untitled

Nov 10th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. int calcul(int n, int &x)
  2. {
  3. while(n)
  4. {
  5. int p=1, x=0;
  6. if((n%10)%2==0)
  7. {
  8. x=x+(n%10)*p;
  9. p=p*10;
  10. }
  11. n=n/10;
  12. }
  13. }
  14.  
  15. int main()
  16. {
  17. int x;
  18. calcul(9278,x);
  19. cout<<x;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement