fork download
  1. #include <stdio.h>
  2. int a(int x){
  3. int i,j,b=1;
  4. for(i=0;i<x;i++){
  5. b+=1;
  6. if(x%b==0){
  7. for(j=0;j<x-1;j++){
  8. if(x%b!=0)
  9. break;
  10. x/=b;
  11. printf("*%d",b);
  12.  
  13. }
  14. }
  15. else if(x==1)
  16. break;
  17.  
  18.  
  19.  
  20. }
  21.  
  22.  
  23. }
  24. int main(void) {
  25. int x;
  26.  
  27. scanf("%d", &x);
  28. printf("%d", x);
  29. a(x);
  30. printf("\r%d=",x);
  31. return 0;
  32. }
Success #stdin #stdout 0s 5288KB
stdin
2016
stdout
2016*2*2*2*2*2*3*3*7
2016=