{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "441c30924add4c18b110cca521fa7736",
  "keywords": "算法高阶,数论算法,素数的测试,算法问题选编",
  "title": "求素数和",
  "desc": [
    {
      "content": "\n求第m个到第n个素数之间的素数和",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "java"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ],
    [
      {
        "content": "",
        "language": "java"
      }
    ]
  ],
  "template": {
    "content": "import java.util.Scanner;\npublic class All {\n   public static void main(String[] args) {\n\t  int a[] = new int[200];\n\t  int index = 0;\n\t  for (int i = 1; i < 200; i++) {\n\t\t boolean isPrime = true;\n\t\t for (int k = 2; k < i; k++) {\n\t\t\tif (i % k == 0) {\n\t\t\t   isPrime = false;\n\t\t\t   break;\n\t\t\t}\n\t\t }\n\t\t if (isPrime) {\n\t\t\ta[index++] = i;\n\t\t\tSystem.out.println(a[index - 1]);\n\t\t }\n\t  }\n\t  Scanner small = new Scanner(System.in);\n\t  Scanner large = new Scanner(System.in);\n\t  int m = small.nextInt();\n\t  int n = large.nextInt();\n\t  int sums = 0;\n\t  int suml = 0;\n\t  int sum = 0;\n\t  for (int i = 0; i < m; i++) {\n\t\t sums += a[i];\n\t\t System.out.print(a[i] + \"*\");\n\t  }\n\t  for (int i = 0; i < n; i++) {\n\t\t suml += a[i];\n\t\t System.out.print(a[i] + \" \");\n\t  }\n\t  sum = suml - sums;\n\t  System.out.println(sum);\n   }\n}",
    "language": "java"
  },
  "node_id": "dailycode-bc6b2d6511254a5f98339f5f75c558a6",
  "license": "csdn.net",
  "created_at": 1637894159,
  "topic_link": "https://bbs.csdn.net/topics/600470196"
}