Skip to content

Instantly share code, notes, and snippets.

@mkljczk
Last active March 24, 2017 22:22
Embed
What would you like to do?
#include <iostream>
bool czyPierwsza(int n)
{
for(int i=2;i<=5000;i++)
{
if(i!=n&&n%i==0) return false;
}
return true;
}
int main()
{
int input;
for(int n;n<100000&&input<=10000;n++)
{
std::cin >> input;
if(czyPierwsza(input)) std::cout << "TAK" << std::endl; else std::cout << "NIE" << std::endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment