Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. // ConsoleApplication13.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.     int n;
  13.     int x[100000];
  14.     cin >> n;
  15.     for(int k = 0; k < n; k++)
  16.     {
  17.         cin >> x[k];
  18.     }
  19.     for (int i = 0; i < n; i++)
  20.     {
  21.         int p = 0;
  22.         for (int j = 1; j <= x[i]; j++)
  23.         {
  24.             if (x[i] > 0)
  25.             {
  26.                 if (x[i] % j == 0)
  27.                 {
  28.                     p++;
  29.                 }
  30.             }
  31.             else
  32.             {
  33.                 cout << "NIE" << endl;
  34.             }
  35.         }
  36.         cout << (p == 2 ? "TAK" : "NIE") << endl;
  37.     }
  38.     system("pause");
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement