

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
#include <iostream>
#include <algorithm>
#define long long long
using namespace std;
bool solve(long x) {
int cnt = 0;
for (long i = 2; i * i <= x; ++i)
while (x % i == 0) x /= i, cnt += 1;
return (cnt + (x != 1)) == 2;
};
int main() {
long n = 1;
cin >> n;
cout << (solve(n) ? "True" : "False");
};
Hãy giúp mọi người biết câu trả lời này thế nào?

Bảng tin
9057
97555
5314
sao chạy lỗi :v [Error] 'solve' does not name a type [Error] 'solve' was not declared in this scope
90
2206
112
v chắc c++14 trở lên mới chạy đc à v:
90
2206
112
thôi lại đưa hàm ra ngoài vậy v: