>>862 #include<stdio.h>
int expr2val(const char *s){
int sum=0, value, n;
while(sscanf(s, "%d%n", &value, &n)>=1) sum+=value,s+=n;
return sum;
}
int main(void)
{
char base[]="123456789", buf[9+3+1];
int i, j, k, l, result;
for(i=1;i<9;i++)
for(j=i+1;j<9;j++)
for(k=j+1;k<9;k++)
for(l=0;l<3;l++){
char sign[]="---";
sign[l]='+';
sprintf(buf, "%.*s%c%.*s%c%.*s%c%s", i, &base[0], sign[0], j-i, &base[i], sign[1], k-j, &base[j], sign[2], &base[k]);
result=expr2val(buf);
if(result==450 || result==500 || result==666) printf("%s=%d\n", buf, result);
}
return 0;
}