ac

Aurora · 发布于 2026-03-15 · 浏览 167 回复 0

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;

}

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复