热门

最新

红包

立Flag

投票

同城

我的

发布
zhongkeyuanchongqing
Data+Science+Insight
4 年前
truezhongkeyuanchongqing

代码,医药,法律,商业,工程,这些都是高贵的理想,并且是维生的必需条件。

但是艺术,诗,美,浪漫,爱,这些才是我们生存的原因。

Human race is filled with passion. And medicine, law, business, engineering, these are noble pursuits and necessary to sustain life. But poetry, beauty,romance, love, these are what we stay alive for.
@ Walt Whitman
--The Dead Poets Society

职言职语
CSDN App 扫码分享
分享
3
6
打赏
  • 复制链接
  • 举报
下一条:
打印所有水仙数 法1:#include <stdio.h> int main() { int a,b,c; int i; for(i=100;i<1000;i++) { a=i%10; b=i%100/10; c=i/100; if(i==(a*a*a+b*b*b+c*c*c)) { printf("%d\n",i); } } return 0; } 法2; #include <stdio.h> int main() { int a,b,c; int i=100; while(i>=100&&i<1000) { a=i%10; b=i%100/10; c=i/100; if(i==(a*a*a+b*b*b+c*c*c)) { printf("%d\n",i); } i++; } return 0; } 法3: #include <stdio.h> int main() { int a,b,c; int i; for(a=1;a<=9;a++){ for(b=0;b<=9;b++){ for(c=0;c<=9;c++){ i=a*100+b*10+c; if(i==(a*a*a+b*b*b+c*c*c)){ printf("%d\n",i); } } } } return 0; }
立即登录