#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
main()
{
int m[10],n, i, t, a, k;
for (n = 2; n <= 1000; n++) //穷举n的取值范围 *
{
t = 0;
a = n;
k = 0;
for (i = 0; a != 0; i++) //从低到高分解数a的每一位存于数组m
{
m[i] = a % 10;
a /= 10;
k++;
}
for (i = 0; i < k; i++)
{
t += pow(m[i], 3);
}
if (t == n)printf("%d ", n);
}
}
标签:include,SECURE,CRT,阿姆斯特朗,NO,main
From: https://www.cnblogs.com/258-333/p/17421693.html