fork 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. printf("%d",i);
  7. if(n!=i){
  8. printf("×");
  9. insu(n/i);
  10. }
  11. return 0;
  12. }
  13. }
  14. }
  15. int main() {
  16. int x;
  17. printf("3以上の整数を入力してください:");
  18. scanf("%d",&x);
  19. printf("%d\n%d=",x,x);
  20. insu(x);
  21. printf("\n続行するには何かキーを押してください...");
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 5316KB
stdin
1974
stdout
3以上の整数を入力してください:1974
1974=2×3×7×47
続行するには何かキーを押してください...