题解 | #牛牛的四叶玫瑰数#
牛牛的四叶玫瑰数
https://www.nowcoder.com/practice/b1ee23676ad54919b50aa1a09da1704e
#include<stdio.h> int main() { int test(int x); long int a, b; scanf("%ld %ld", &a, &b); int z; z = b - a; int i; for (i = a; i <= b; i++) { if (i >= 10000) { break; } else if (test(i)) { printf("%lld", i); printf(" "); } } } int test(int x) { int d, e, f, g, m; f = (x / 100) % 10; e = (x / 10) % 10; d = x % 10; g = x / 1000; m = d * d * d * d + e * e * e * e + f * f * f * f + g * g * g * g; return x == m; }