考拉数:求一个三位数,该三位数等与其每位数字的阶乘之和

function jiecheng(a){
            var s = 1;
            for(var i=1;i<=a;i++){
                s *= i;
            }
            return s;
        }

        function tol(b){
            var sum = 0;
                var gewei = b%10;
                var shiwei = parseInt(b/10%10);
                var baiwei = parseInt(b/100%10);
                var qianwei = 
                if(jiecheng(gewei) + jiecheng(shiwei) +jiecheng(baiwei) == b){
                    console.log(b);
                }

        }
        for(var i =100;i<=999;i++){
            tol(i);
        }

你可能感兴趣的:(javascript)