#include <iostream>
#include <algorithm>
using namespace std;
int a[9]={1,2,3,4,5,6,7,8,9};
int func(int l,int r){
int res=0;
for(int i=l;i<=r;i++)
res=res*10+a[i];
return res;
}
int main()
{
int n,sum=0;cin>>n;
do{
for(int i=0;i<6;i++){
for(int j=i+1;j<8;j++){
int a=func(0,i);
int b=func(i+1,j);
int c=func(j+1,8);
if(a + b*1.0/c == n) sum++;
}
}
}while(next_permutation(a,a+9));
cout<<sum<<endl;
return 0;
}
转载请注明原文地址:https://blackberry.8miu.com/read-33212.html