Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<cstdio>
  4. using namespace std;
  5. void czypierwsza(int liczba)
  6. {
  7. int j=0;
  8. for(int i=2; i<liczba; i++)
  9. {
  10. if(liczba%i==0)
  11. {
  12. cout<<liczba<<"jest podzielna przez "<<i<<endl;
  13. j++;
  14. }
  15. }
  16. if(j==0)
  17. cout<<liczba<<" jest lcizba pierwsza elo"<<endl;
  18. }
  19. main()
  20. {
  21. int tab[3]={3, 8, 11}, rozmiar=3;
  22.  
  23.  
  24. for(int i=0;i<rozmiar; i++)
  25. {
  26. czypierwsza(tab[i]);
  27. }
  28.  
  29. system("pause");
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement