Kassiow

l pierwsza dobra

Nov 27th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int test, liczba;
  6.  
  7. int main()
  8. {
  9.     cin >> test;
  10.  
  11.     for(int i=0; i<test; i++)
  12.     {
  13.         cin >> liczba;
  14.         for (int i=2; i<=liczba; i++){
  15.             if (liczba%i==0){
  16.                 if (i==liczba) cout<<"TAK"<<endl;
  17.                 else cout<<"NIE"<<endl;
  18.                 break;
  19.             }
  20.  
  21.         }
  22.  
  23.  
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment