C语言函数计算x^2-2x+6的值:代码解析与答案
#include 'stdio.h'
float fun(float x) { float y; y = x * x - 2 * x + 6; return y; }
int main() { float x, y1, y2; scanf("%f", &x); y1 = fun(x - 1); y2 = fun(x + 1); printf("y1=%f, y2=%f ", y1, y2); }
答案:
- float fun(float x);
- return y;
- x - 1
- x + 1
原文地址: https://www.cveoy.top/t/topic/n4oj 著作权归作者所有。请勿转载和采集!