Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- bool czyPierwsza(int x){
- if( x<2 ){
- return false;
- }else{
- for(int i=2; i<x; i++){
- if( x%i == 0 ){
- return false;
- }
- }
- return true;
- }
- {
- int main()
- printf("Podaj liczbe: ");
- int n;
- scanf("%d", &n);
- for(int i=1; i <= n*10; i++){
- if( czyPierwsza(i) == false ){
- }
- printf("%d ", i);
- }
- }
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement