fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5. int z,x,t,i=2;
  6. int const p=100;
  7. int arr[p];
  8. for (z=0;z<p;z++)
  9. {
  10. arr[z]=0;
  11. }
  12. scanf("%d",&t);
  13. for (x=0;i<=t;)
  14. {
  15. if(t%i==0)
  16. {
  17. if (arr[x-1]!=i)
  18. {
  19. arr[x]=i;
  20. x++;
  21. }
  22. printf("%d ",i);
  23. t=t/i;
  24. }
  25. else
  26. {
  27. i=i+1;
  28. }
  29. }
  30. printf ("\n\n");
  31. for (i=0;arr[i]!=0;i++)
  32. {
  33. printf ("%d ",arr[i]);
  34. }
  35. return 0;
  36. }
Success #stdin #stdout 0s 2296KB
stdin
1764
stdout
2 2 3 3 7 7 

2 3 7