Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- int main()
- {
- int n, i;
- int k=1;
- int m=0;
- scanf("%d", &n);
- printf("1 ");
- while(k<=n)
- {
- for(i=1; i<=k; ++i)
- {
- //printf("%d %f\n",(int)(k/i), (float)k/i);
- if(((int)k/i-(float)k/i)==0)
- m++;
- }
- //printf("\n");
- if(m==2)
- printf("%d ", k);
- m=0;
- ++k;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement