Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int putere(int n, int p) {
- if ((p != 2 && p % 2 == 0) || p == 1) {
- return -1;
- }
- for (int i = 3; i * i <= n; i += 2) {
- if (p % i == 0) {
- return -1;
- }
- }
- int nr = 0;
- while (n % p == 0) {
- nr++;
- n /= p;
- }
- return nr;
- }
- int main() {
- //call here
- return 0;
- }
Add Comment
Please, Sign In to add comment