{ "question_id": 7462901, "question_title": "存了多少零钱", "question_content": "

小林和小树兄弟俩相约存零钱。眼看到年底了,兄弟俩决定算算一共存了多少钱,请帮他们算出来。

输入:

两行,第一行三个整数分别对应元、角、分,表示小林存的零钱数;

第二行三个整数分别对应元、角、分,表示小树存的零钱数。

输出:

两人存的钱数(单位:元,保留2位小数)

样例输入:

30 5 5

45 7 4

样例输出:

76.29

", "difficulty": "简单", "answer_id": 53448638, "answer_content": "

代码如下,如有帮助,请采纳一下,谢谢。

\n\n
\n#include <stdio.h>\n\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\n\t\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\t\n\tss = y + j/10.0 + f/100.0;\n\tprintf("%.2f\\n",ss);\n\treturn 0;\n}
\n\n

 

\n", "tag_name": "c++", "cpp": "#include \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}", "topic_link": "https://bbs.csdn.net/topics/600470175", "status": 1, "keywords": "算法高阶,数论算法,算法问题选编,整数的因子分解", "license": "csdn.net", "notebook": { "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/103.ipynb?type=file" }, "notebook_enable": 1, "author": "chinachenlu" }