#include <stdio.h>#include <conio.h>#include <math.h>int main(){ for(long n=2,z1=3,z2,zq;n<=20;z1=(long)pow(2,++n)-1){ for(z2=2,zq=(long)sqrt(z1);z2<=zq;z2++)if(z1%z2==0)break; if(z2>zq)printf("%.lf\n",(pow(2,n-1)*z1)); } getch();return 0;}
【评论】 【打印】 【字体:大 中 小】 本文链接:http://blog.pfan.cn/yzfy/24279.html
#include <stdio.h>#include <conio.h>#include <math.h>int main(){ for(long n=2,z1=3,z2,zq;n<=20;z1=(long)pow(2,++n)-1){ for(z2=2,zq=(long)sqrt(z1);z2<=zq;z2++)if(z1%z2==0)break; if(z2>zq)printf("%.lf\n",(pow(2,n-1)*z1)); } getch();return 0;}
阅读(4944) | 评论(11)
版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!
评论