{
  "question_id": 7449614,
  "question_title": "计算函数的值",
  "question_content": "<p>编程输入实数x&#xff0c;计算下面函数的值&#xff0c;并输出y的值&#xff0c;并输出y的值&#xff1b;\nx<sup>2</sup>         x&lt;1\n3x-1      1≦x≦10\nx/5        x&gt;10</p>",
  "difficulty": "简单",
  "answer_id": 53429821,
  "answer_content": "<p><u><strong>代码如下&#xff0c;请采纳&#xff0c;谢谢&#xff0c;不明白地方随时交流</strong></u></p>\n\n<pre>\n<code># include&lt;stdio.h&gt;\n# include&lt;stdlib.h&gt;\n\nint main(void)\n{\n\tfloat x,y;\n\n\tprintf(&#34;请输入x的值&#xff1a;\\n&#34;);\n\tscanf(&#34;%f&#34;,&amp;x);\n\n\tif(x&lt;1)\n\t{\n\t\ty &#61; x * x;\n\t}\n\telse if(x&lt;&#61;10)\n\t{\n\t\ty&#61;3*x-1;\n\t}\n\telse\n\t{\n\t\ty&#61; x / 5;\n\t}\n\n\tprintf(&#34;y的值为&#xff1a;%f\\n&#34;,y);\n\n\tsystem(&#34;pause&#34;);\n\treturn 0;\n}</code></pre>\n\n<p> </p>\n",
  "tag_name": "c++",
  "cpp": "# include<stdio.h>\n# include<stdlib.h>\nint main(void)\n{\n\tfloat x,y;\n\tprintf(\"请输入x的值：\\n\");\n\tscanf(\"%f\",&x);\n\tif(x<1)\n\t{\n\t\ty = x * x;\n\t}\n\telse if(x<=10)\n\t{\n\t\ty=3*x-1;\n\t}\n\telse\n\t{\n\t\ty= x / 5;\n\t}\n\tprintf(\"y的值为：%f\\n\",y);\n\tsystem(\"pause\");\n\treturn 0;\n}",
  "topic_link": "https://bbs.csdn.net/topics/600470171",
  "status": 1,
  "keywords": "算法初阶,基础知识,函数的增长,标准记号与常用函数",
  "license": "csdn.net",
  "notebook": {
    "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/91.ipynb?type=file"
  },
  "notebook_enable": 1,
  "author": "hp_innovation"
}