//给定一个n,取x<=n,则x的每一位上的数之和加x等于n缘由https://ask.csdn.net/?spm=1005.2025.3001.4492
int n = 11, x = 10, he = x, d = x;
while (n <= 474)
{
d = he = x;
while (he)d += he % 10, he /= 10;
if (d == n)cout << n << "=>" << x << ";", x = (++n >= 40 ? n - 20 : 10); else if (x <= n)++x; else x = (++n >= 40 ? n - 20 : 10);
}