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