Zadatak65.

#include <iostream>

using namespace std;

int main()
{
int i,j,n,br;
cin>>n;
int a[n];
for(i=0;i<n;i++)
cin>>a[i];

for(i=0;i<n;i++)
{
br=0;
for(j=1;j<=a[i];j++)
if(a[i]%j==0 ) br=br+1;
if(br==2)
cout<<a[i]<<“ „; }
return 0;
}

Advertisements