热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_44450423
MaKe菠萝包
3 年前
trueweixin_44450423

大家是怎么学 Java的 求求经验

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
蓝桥杯2017第二题大学b组省赛等差素数列题解#include <stdio.h>#include <math.h>int notPrime(int x) { if (x < 4) return 0; else { for (int i = 2; i <= sqrt(x); i++) if (x % i == 0) return 1; return 0; }}int main() { int first, i; for (int delta = 2; delta < 500; delta++) { first = 2; for (int x = 2; x < 5000; x++) { x = first; i = 1; while (!(notPrime(x))) { x += delta; i++; if (i == 10) { printf("%d", delta); return 0; } } first++; } }}
立即登录