四位数中,各位数字之和是13的四位数有多少?
楼上答非所问。
这个问题,按照4个数字之和为13的组合进行分类统计,可以手工计算。不过,和值的组合数量有32种(0049,0058.....),比较费时,容易出错。
编程枚举了一下,是偷懒的办法。
一共有405个这样的四位数。
1039,1048,1057,1066,1075,1084,1093,1129,1138,1147,1156,1165,1174,1183,1192,1219,1228,1237,1246,1255,1264,1273,1282,1291,1309,1318,1327,1336,1345,1354,1363,1372,1381,1390,1408,1417,1426,1435,1444,1453,1462,1471,1480,1507,1516,1525,1534,1543,1552,1561,1570,1606,1615,1624,1633,1642,1651,1660,1705,1714,1723,1732,1741,1750,1804,1813,1822,1831,1840,1903,1912,1921,1930,2029,2038,2047,2056,2065,2074,2083,2092,2119,2128,2137,2146,2155,2164,2173,2182,2191,2209,2218,2227,2236,2245,2254,2263,2272,2281,2290,2308,2317,2326,2335,2344,2353,2362,2371,2380,2407,2416,2425,2434,2443,2452,2461,2470,2506,2515,2524,2533,2542,2551,2560,2605,2614,2623,2632,2641,2650,2704,2713,2722,2731,2740,2803,2812,2821,2830,2902,2911,2920,3019,3028,3037,3046,3055,3064,3073,3082,3091,3109,3118,3127,3136,3145,3154,3163,3172,3181,3190,3208,3217,3226,3235,3244,3253,3262,3271,3280,3307,3316,3325,3334,3343,3352,3361,3370,3406,3415,3424,3433,3442,3451,3460,3505,3514,3523,3532,3541,3550,3604,3613,3622,3631,3640,3703,3712,3721,3730,3802,3811,3820,3901,3910,4009,4018,4027,4036,4045,4054,4063,4072,4081,4090,4108,4117,4126,4135,4144,4153,4162,4171,4180,4207,4216,4225,4234,4243,4252,4261,4270,4306,4315,4324,4333,4342,4351,4360,4405,4414,4423,4432,4441,4450,4504,4513,4522,4531,4540,4603,4612,4621,4630,4702,4711,4720,4801,4810,4900,5008,5017,5026,5035,5044,5053,5062,5071,5080,5107,5116,5125,5134,5143,5152,5161,5170,5206,5215,5224,5233,5242,5251,5260,5305,5314,5323,5332,5341,5350,5404,5413,5422,5431,5440,5503,5512,5521,5530,5602,5611,5620,5701,5710,5800,6007,6016,6025,6034,6043,6052,6061,6070,6106,6115,6124,6133,6142,6151,6160,6205,6214,6223,6232,6241,6250,6304,6313,6322,6331,6340,6403,6412,6421,6430,6502,6511,6520,6601,6610,6700,7006,7015,7024,7033,7042,7051,7060,7105,7114,7123,7132,7141,7150,7204,7213,7222,7231,7240,7303,7312,7321,7330,7402,7411,7420,7501,7510,7600,8005,8014,8023,8032,8041,8050,8104,8113,8122,8131,8140,8203,8212,8221,8230,8302,8311,8320,8401,8410,8500,9004,9013,9022,9031,9040,9103,9112,9121,9130,9202,9211,9220,9301,9310,9400,
total = 405
附:fortran代码
广告 您可能关注的内容 |