Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void produs(unsigned int n, int &p)
- {
- int AP[10] = {0};
- p = 1;
- while(n != 0)
- {
- int c = n % 10;
- n = n / 10;
- if(c % 2 == 0 && AP[c] == 0)
- AP[c] = 1;
- }
- for(int i = 2; i <= 8; i = i + 2)
- {
- if(AP[i] == 1)
- p = p * i;
- }
- if(p == 1)
- p = -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement