标签:
习题2-1 水仙花数(daffodil)
1 #include <stdio.h> 2 int main(void) 3 { 4 for (int i = 1; i < 10; i++) 5 for (int j = 0; j < 10; j++) 6 for (int k = 0; k < 10; k++) 7 if (i*100 + j*10 + k == i*i*i + j*j*j + k*k*k) 8 printf("%d\n", i*100 + j*10 + k); 9 return 0; 10 }
标签:
原文地址:http://www.cnblogs.com/untitled/p/4566018.html