{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "5265ade74d9c43c98e2a88eb972630b6",
  "keywords": "算法初阶,基础知识,分治策略,证明主定理,对b的幂证明主定理",
  "title": "完数",
  "desc": [
    {
      "content": "\n<pre>一个数如果恰好等于它的所有因子之和&#xff0c;这个数就称为“完数”。统计自然数 1 — 100 间完数的个数。</pre>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include<stdio.h>\nint perfect()\n{\n\tint i,x,sum,cnt=0;\n\tfor(i=1;i<=100;i++)\n\t{\n\t\tsum=0;\n\t\tfor(x=1;x<i;x++)\n\t\t{\n\t\t\tif(i%x==0)sum+=x;\n\t\t}\n\t\tif(i==sum)\n\t\t{\n\t\t\tcnt++;\n\t\t\tprintf(\"%d \",i);\n\t\t}\n\t}\n\treturn cnt;\n}\nint main()\n{\n\tprintf(\"\\ncount=%d\\n\",perfect());\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-5b037f31a3c849158d21cbaed4173fa7",
  "license": "csdn.net",
  "created_at": 1637894158,
  "topic_link": "https://bbs.csdn.net/topics/600469960"
}