Advertisement
Guest User

Untitled

a guest
Aug 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned int tab[100000];
  7. unsigned int a;
  8. cin >> a;
  9. if (a <= 100000 && a > 0)
  10. {
  11. for (int i = 0; i < a; i++)
  12. {
  13. cin >> tab[i];
  14. if (tab[i] == 1)
  15. tab[i] = 0;
  16. else
  17. {
  18. if (tab[i] == 2 || tab[i] == 3 || tab[i] == 5)
  19. tab[i] = 1;
  20. else
  21. {
  22. if ((tab[i] % 2 != 0) && (tab[i] % 3 != 0) && (tab[i] % 5 != 0))
  23. tab[i] = 1;
  24. else tab[i] = 0;
  25. }
  26. }
  27. }
  28. for (int j = 0; j < a; j++)
  29. {
  30. if (tab[j] == 1)
  31. cout << "TAK"<<endl;
  32. else cout << "NIE" << endl;
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement