判断水仙花数
/* 功能:判断水仙花数 日期:2013-4-19 */ #include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { int n,i,j,k; printf(“水仙花数为:”); for (n=100;n<1000;n++) { i=n/100; j=(n%100)/10; k=n%10; if (i*100+j*10+k==i*i*i+k*k*k+j*j*j) { printf("%d ",n); } } printf(“n”); system(“pause”); return 0; }
预览
除特别注明外,本站所有文章均为 Windcoder网 原创,转载请注明出处来自: judged-daffodil
Loading comments...

预览
暂无数据