#include #include int main() { int sm,vl; sm=0;vl=3; while(vl<=40585) // http://mathworld.wolfram.com/Factorion.html { if(fct(vl)==0) sm+=vl; vl++; } printf("\n\t%i\n\n",sm); system("pause"); return 0; } int fct(int vl) { int a,b,c,d; a=vl;d=0; while(a%10!=0||a/10!=0) { b=a%10; c=1; for(;b>1;b--) c*=b; a/=10; d+=c; } if(vl==d) return 0; else return 1; }