Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- int main()
- {
- int b[50000],a[100000],N,K,i,c[50000],x=0,j;
- scanf("%d%d",&N,&K);
- for(i=0;i<=N/2;i++)
- {
- b[i]=0;
- }
- for(i=2;i<=sqrt(N/2+1);i++)
- {
- for(j=i*2;j<N/2;j=j+i)
- {
- b[j]=1;
- }
- }
- for(i=2;i<=N/2;i++)
- {
- if(b[i]==0)
- {
- if(N%i==0)
- {
- c[x]=i;
- x++;
- }
- }
- }
- for(i=0;i<x;i++)
- printf("%d",c[x]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement