Last active
March 24, 2017 22:22
-
-
Save mkljczk/c3e4ba013a14b3568f60b01595ea04cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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