Im new in this website and I have a problem with one request on this website.
Im doing this: http://pl.spoj.com/problems/PRIME_T/
That is my code. Can you tell my why it dont want to work:
#include<iostream>
#include<cstdlib>
using namespace std;
bool czy_pierwsza(int n)
{
if(n<2)
return false;
for(int i=2;i*i<=n;i++)
if(n%i==0)
return false;
return true;
}
int main()
{
for(int n=1;n<100000;n++)
{
if(czy_pierwsza(n))
cout<<"TAK"<<endl;
else
cout<<"NIE"<<endl;
}
system("pause");
return 0;
}