#include <iostream>
using namespace std;
bool IsSimple(int n) {
if (n < 2)
return false;
for (int j = 2; j * j <= n; ++j)
if (n % j == 0)
return true;
}
int main()
{
const int n = 10;
int a[n];
for (int i=0; i<n; i++)
cin>>a[i];
if (IsSimple(a[i]))
cout<<a[i]<<" ";
return 0;
#include <iostream>
using namespace std;
bool IsSimple(int n) {
if (n < 2)
return false;
for (int j = 2; j * j <= n; ++j)
if (n % j == 0)
return false;
return true;
}
int main()
{
const int n = 10;
int a[n];
for (int i=0; i<n; i++)
cin>>a[i];
for (int i=0; i<n; i++)
if (IsSimple(a[i]))
cout<<a[i]<<" ";
return 0;
}