#include <iostream>
#include <cstdlib>
using namespace std;
bool first(int n)
{
if(n<2)
return true;
for(int i=2;i<n;i++)
{
if((n%i)== 0)
{
return false;
}
}
return true;
}
void writing_out(int n, int liczba)
{
int *p = new int [liczba];
for(int i=0;i<liczba;i++)
{
cout<<"Podaj liczbe pierwsza: ";
cin>>n;
if(first(n))
{
*(p+i)=1;
}
else
{
*(p+i)=0;
}
}
for(int i=0;i<liczba;i++)
{
if(*(p+i))
{
cout<<"TAK\n";
}
else
{
cout<<"NIE\n";
}
}
delete[] p;
}
int main()
{
int value;
int amount;
cout<<"Podaj ilosc liczb: ";
cin>>amount;
writing_out(value, amount);
system("pause");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGxpYj4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmJvb2wgZmlyc3QoaW50IG4pCnsKCQogICAgaWYobjwyKQogICAgcmV0dXJuIHRydWU7CgkKCQoJZm9yKGludCBpPTI7aTxuO2krKykKCXsKCQlpZigobiVpKT09IDApCgkJewoJcmV0dXJuIGZhbHNlOwoJCX0KCQkKCX0KCQoJcmV0dXJuIHRydWU7Cn0KCnZvaWQgd3JpdGluZ19vdXQoaW50IG4sIGludCBsaWN6YmEpCnsKCWludCAqcCA9IG5ldyBpbnQgW2xpY3piYV07CgoKZm9yKGludCBpPTA7aTxsaWN6YmE7aSsrKQp7CmNvdXQ8PCJQb2RhaiBsaWN6YmUgcGllcndzemE6ICI7CmNpbj4+bjsJCgppZihmaXJzdChuKSkKCXsKCQkqKHAraSk9MTsKCX0KCWVsc2UKCXsKCQkqKHAraSk9MDsKCX0KfQoKZm9yKGludCBpPTA7aTxsaWN6YmE7aSsrKQp7CmlmKCoocCtpKSkKICAgIHsKCWNvdXQ8PCJUQUtcbiI7Cgl9CQoJZWxzZQoJewoJY291dDw8Ik5JRVxuIjsKCX0KfQoKZGVsZXRlW10gcDsKfQoKaW50IG1haW4oKQp7CgppbnQgdmFsdWU7CmludCBhbW91bnQ7CmNvdXQ8PCJQb2RhaiBpbG9zYyBsaWN6YjogIjsKY2luPj5hbW91bnQ7Cgp3cml0aW5nX291dCh2YWx1ZSwgYW1vdW50KTsKCnN5c3RlbSgicGF1c2UiKTsKcmV0dXJuIDA7Cn0=