Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1.  
  2. #include <cstdio>
  3.  
  4. bool czyPierwsza(int x){
  5. if( x<2 ){
  6. return false;
  7. }else{
  8. for(int i=2; i<x; i++){
  9. if( x%i == 0 ){
  10. return false;
  11. }
  12. }
  13. return true;
  14. }
  15. {
  16. int main()
  17. printf("Podaj liczbe: ");
  18. int n;
  19. scanf("%d", &n);
  20. for(int i=1; i <= n*10; i++){
  21. if( czyPierwsza(i) == false ){
  22. }
  23. printf("%d ", i);
  24. }
  25. }
  26.  
  27. return (0);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement