hopingsteam

Untitled

May 11th, 2020
1,175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void produs(unsigned int n, int &p)
  2. {
  3.     int AP[10] = {0};
  4.    
  5.     p = 1;
  6.     while(n != 0)
  7.     {
  8.         int c = n % 10;
  9.         n = n / 10;
  10.         if(c % 2 == 0 && AP[c] == 0)
  11.             AP[c] = 1;
  12.     }
  13.     for(int i = 2; i <= 8; i = i + 2)
  14.     {
  15.         if(AP[i] == 1)
  16.             p = p * i;
  17.     }
  18.  
  19.     if(p == 1)
  20.         p = -1;
  21. }
RAW Paste Data