This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include <bits/stdc++.h>
using namespace std;
//利用分解质因数模板,扩展出是不是漂亮数
bool isPLS(int x) {
for (int i = 2; i * i <= x; i++) {
int s = 0;
while (x % i == 0) x /= i, s++;
//只有1个因子,就不是漂亮数
if (s == 1) return false;
}
//如果存在一个大的质数因子,也不是漂亮树
if (x > 1) return false;
return true;
int m, n, cnt;
int main() {
cin >> m >> n;
for (int i = m; i < n; i++)
if (isPLS(i) && isPLS(i + 1)) {
printf("%d %d\n", i, i + 1);
cnt++;
if (!cnt) printf("no find");
return 0;