{ "question_id": 7449614, "question_title": "计算函数的值", "question_content": "
编程输入实数x,计算下面函数的值,并输出y的值,并输出y的值;\nx2 x<1\n3x-1 1≦x≦10\nx/5 x>10
", "difficulty": "简单", "answer_id": 53429821, "answer_content": "代码如下,请采纳,谢谢,不明白地方随时交流
\n\n\n# include<stdio.h>\n# include<stdlib.h>\n\nint main(void)\n{\n\tfloat x,y;\n\n\tprintf("请输入x的值:\\n");\n\tscanf("%f",&x);\n\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\n\tprintf("y的值为:%f\\n",y);\n\n\tsystem("pause");\n\treturn 0;\n}
\n\n\n", "tag_name": "c++", "cpp": "# include