Guest User

Untitled

a guest
Mar 25th, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int suma_tablic,liczba[10000],i=0,j,wskaznik;
  4. int main()
  5. {
  6. cin>>suma_tablic;
  7. for(i; i<suma_tablic; i++)
  8. {
  9. cin>>liczba[i];
  10. wskaznik=0;
  11. if(liczba[i]<=1)
  12. wskaznik++;
  13. for(j=1; j<=liczba[i]/2; j++)
  14. if(liczba[i]%j==0 && j!=1)
  15. wskaznik++;
  16. if(wskaznik==0)
  17. cout<< liczba[i] << " TAK" <<endl;
  18. else
  19. cout<< liczba[i] << " NIE" <<endl;
  20. }
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment