fork(1) download
  1. //完成しています
  2. #include <stdio.h>
  3.  
  4. int main(){
  5. int a,b,c,i,j,x;
  6. scanf("%d",&x);
  7. printf("式の値を入力してください:%d\n",x);
  8. for( i=1; i<=9; i++ ){
  9. c=x%i;
  10. b=x/i;
  11. if((b>=0)&&(b<=9)){
  12. for( j=0; j<=9-i; j++ ){
  13. a=j+i;
  14. printf("(%d-%d)*%d+%d\n",a,j,b,c);
  15. }
  16. }
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5272KB
stdin
32
stdout
式の値を入力してください:32
(4-0)*8+0
(5-1)*8+0
(6-2)*8+0
(7-3)*8+0
(8-4)*8+0
(9-5)*8+0
(5-0)*6+2
(6-1)*6+2
(7-2)*6+2
(8-3)*6+2
(9-4)*6+2
(6-0)*5+2
(7-1)*5+2
(8-2)*5+2
(9-3)*5+2
(7-0)*4+4
(8-1)*4+4
(9-2)*4+4
(8-0)*4+0
(9-1)*4+0
(9-0)*3+5