递归错误:无法检查给定数字是否为强数

时间:2017-08-22 17:35:58

标签: python python-3.x

我无法检查给定号码是否为强号...

强号码:如果任何号码中的数字的阶乘之和等于给定的数字,则该号码称为STRONG号码。

例如= 1! +4! +5!= 1 + 24 + 120 = 145

这是我的代码..

EntityType

我收到递归错误

DataTable _dataSourceMatrix = GetManager.Budget.GetAll().ConvertToDataTable();

DataTable _joinTable = null;
string _joinField = String.Empty;

switch (EntityType) {
    case DomainType.Department:
        joinTable = GetManager.DepartmentManager.GetAll().ConvertToDataTable();
        _joinField = "DepartmentID";
        break;
}


var _genericBudgetJoinDepartmentList = from a in _dataSourceMatrix.AsEnumerable()
                                       join b in _joinTable.AsEnumerable()
                                       on a.Field<int>("EntityID") equals b.Field<int>(_joinField)
                                       select new { EntityName = b.Field<string>("Name"), Period = a.Field<string>("Period"), Value = a.Field<double>("Value"), EntityID = a.Field<int>("EntityID") };

_dataSourceMatrix = _genericBudgetJoinDepartmentList.OrderBy(x => x.Period).ConvertToDataTable();

0 个答案:

没有答案