Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. int eNumarPuternic(int numar, int p);
  2.  
  3. int eNumarPuternic(int numar, int p) {
  4. if(numar < 0) // daca nu e numar natural
  5. return 0; // din start nu are sansa sa fie numar puternic
  6.  
  7. if(numar % p == 0) {
  8. if(numar % p*p == 0)
  9. return 1;
  10. else
  11. return 0;
  12. }
  13. else
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement