ac

你的刀盾  •  19天前


include<bits/stdc++.h>

using namespace std;

int main() {

int n;
cin >> n;

int f = 0;  
int e = 0; 

for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
        int c = 0;  
        while (n % i == 0) {
            ++c;
            n /= i;
        }
        if (c > e) {
            e = c;
            f = i;
        }
    }
}

if (n > 1 && 1 > e) {
    e = 1;
    f = n;
}

cout << f << " " << e << endl;
return 0;

}


评论:

请先登录,才能进行评论