solution.json 2.4 KB
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
{
  "type": "code_options",
  "author": "csdn.net",
  "source": "solution.md",
  "exercise_id": "2081a5fe4b7a48a19ee2cbab00388ec7",
  "keywords": "算法高阶,数论算法,算法问题选编,整数的因子分解",
  "title": "存了多少零钱",
  "desc": [
    {
      "content": "\n<p style=\"margin-left:.0001pt; margin-right:0\">小林和小树兄弟俩相约存零钱。眼看到年底了&#xff0c;兄弟俩决定算算一共存了多少钱&#xff0c;请帮他们算出来。</p><p style=\"margin-left:.0001pt; margin-right:0\">输入&#xff1a;</p><p style=\"margin-left:.0001pt; margin-right:0\">两行&#xff0c;第一行三个整数分别对应元、角、分&#xff0c;表示小林存的零钱数&#xff1b;</p><p style=\"margin-left:.0001pt; margin-right:0\">第二行三个整数分别对应元、角、分&#xff0c;表示小树存的零钱数。</p><p style=\"margin-left:.0001pt; margin-right:0\">输出&#xff1a;</p><p style=\"margin-left:.0001pt; margin-right:0\">两人存的钱数&#xff08;单位&#xff1a;元&#xff0c;保留2位小数)</p><p style=\"margin-left:.0001pt; margin-right:0\">样例输入&#xff1a;</p><p style=\"margin-left:.0001pt; margin-right:0\">30 5 5</p><p style=\"margin-left:.0001pt; margin-right:0\">45 7 4</p><p style=\"margin-left:.0001pt; margin-right:0\">样例输出&#xff1a;</p><p style=\"margin-left:.0001pt; margin-right:0\">76.29</p>",
      "language": "markdown"
    }
  ],
  "answer": [
    {
      "content": "",
      "language": "cpp"
    }
  ],
  "prepared": [
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ],
    [
      {
        "content": "",
        "language": "cpp"
      }
    ]
  ],
  "template": {
    "content": "#include <stdio.h>\nint main()\n{\n\tint y1,j1,f1,y2,j2,f2;\n\tint y,j,f;\n\tint shiftj = 0;\n\tint shifty = 0;\n\tfloat ss ;\n\tscanf(\"%d %d %d\",&y1,&j1,&f1);\n\tscanf(\"%d %d %d\",&y2,&j2,&f2);\n\tf = f1 + f2;\n\tif(f>=10)\n\t{\n\t\tf = f-10;\n\t\tshiftj = 1;\n\t}\n\tj = j1 + j2 + shiftj;\n\tif(j >= 10)\n\t{\n\t\tj = j - 10;\n\t\tshifty = 1;\n\t}\n\ty = y1 + y2 + shifty;\n\tss = y + j/10.0 + f/100.0;\n\tprintf(\"%.2f\\n\",ss);\n\treturn 0;\n}",
    "language": "cpp"
  },
  "node_id": "dailycode-e6f4640190ed47628252f04040268ad8",
  "license": "csdn.net",
  "created_at": 1637894160,
  "topic_link": "https://bbs.csdn.net/topics/600470175"
}