fork download
  1. #include <stdio.h>
  2. int main() {
  3. int a,b,c,d,e;
  4. scanf("%d",&e);
  5. for ( a=0; a<=9 ; a++ ) {
  6. for ( b=0; b<=9 ; b++ )
  7. for ( c=0; c<=9 ; c++ )
  8. for ( d=0; d<=9 ; d++ )
  9. if((a-b)*c+d==e)
  10. printf("(%d-%d)*%d+%d\n",a,b,c,d); }
  11.  
  12. return 0;
  13.  
  14. }
  15.  
Success #stdin #stdout 0.01s 5308KB
stdin
90
stdout
(9-0)*9+9