分析:瞎搞。。。
結果:40785
#include<bits/stdc++.h>
using namespace std;
bool check(int x){//判斷該數x是否包含2、4
while(x>0){
if(x%10==2||x%10==4)
return true;
x/=10;
}
return false;
}
int main()
{
int x,ans=0;
cin>>x;
//i、j、k順序不會重疊即可
for(int i=1;i<x;i++)
for(int j=i+1;j<x;j++)
for(int k=j+1;k<x;k++)
if(x==i+j+k&&check(i)==false&&check(j)==false&&check(k)==false)ans++;
cout<<ans<<endl;
return 0;
}