Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool pierwsza(int a)
- {
- if (a<=1) return 0;
- for (int i=2;i<a-1;i++)
- if (a%i==0) return 0;
- return 1;
- }
- int main()
- {
- int a;
- cin >> a;
- int x;
- for(int i=0;i<a;i++)
- {
- cin >> x;
- if (pierwsza(x)) cout <<"TAK"<<endl;
- else cout <<"NIE"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement