code mình sai chỗ nào chỉ mình với
#include <bits/stdc++.h>
using namespace std;
bool snt(int n)
{
if(n < 2) return 0;
for(int i = 2; i * i <= n; i++)
{
if(n % i == 0) return 0;
}
return 1;
}
bool sdb(int n)
{
int sqrtn = sqrt(n);
if(n == sqrtn * sqrtn && snt(sqrtn) == 1) return 1;
return 0;
}
int main()
{
ios_base :: sync_with_stdio(0);
cin.tie(NULL);
int n;
cin >> n;
int a[n + 1];
for(int i = 1; i <= n; i++)
{
cin >> a[i];
while(sdb(a[i]) == 0)
{
a[i]++;
}
cout << a[i] << " ";
}
}
lưu ý làm theo cách của mình nhé





đề bài đây nhé