三少爷

专注~~~

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2012年3月29日

摘要: #include <stdio.h>#include <stdlib.h>#include <math.h>void main(){ int i,j; for(i = 2;i <=300;i++) { for(j = 2;j < i/2;j++) { if((i % j) == 0) break; } if(j ==i/2) { printf("%d\n",i); } } system("pause");} 阅读全文
posted @ 2012-03-29 16:09 三少_爷 阅读(95) 评论(0) 推荐(0) 编辑

摘要: #include <stdio.h>#include <stdlib.h>void main(){ int x,y,z; int d; for(int i = 100; i < 500;i++) { d = i; x = d%10; d = d/10; y = d%10; d = d/10; z = d; if( i == (x * x * x + y * y * y + z * z * z)) { printf("%d: %d %d %d\n",i,z,y,x); } } system("pause");} 阅读全文
posted @ 2012-03-29 15:29 三少_爷 阅读(119) 评论(0) 推荐(0) 编辑