fork(1) download
  1. #include <stdio.h>
  2. int insu(int n){
  3. int i;
  4. for(i=2;i<n;i++){
  5. if(n%i==0){
  6. insu(n/i);printf("%d×",i);}
  7. else if(n==1)
  8. return 0;
  9.  
  10. }
  11. }
  12. int main() {
  13. int x;
  14. printf("3以上の整数を入力してください:");
  15. scanf("%d",&x);
  16. printf("%d\n%d=",x,x);
  17. insu(x);
  18. printf("\n続行するには何かキーを押してください...");
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.01s 5308KB
stdin
1974
stdout
3以上の整数を入力してください:1974
1974=7×47×3×3×47×7×21×3×7×47×141×329×2×7×47×2×2×47×7×14×2×7×47×94×329×3×7×47×6×3×47×2×2×47×3×6×2×3×47×94×141×7×3×47×14×2×47×21×42×3×7×2×2×7×3×6×2×3×7×14×21×47×3×7×94×2×7×141×282×2×3×329×658×987×
続行するには何かキーを押してください...