← 查看本卷题目GESP C++ 4级2024年12月单选题 第1题 · 2 分下面的语句中,( )正确定义了一个计算浮点数 xxx 的平方(x2=x⋅xx^2=x\cdot xx2=x⋅x)的函数,并成功调用该函数。 填写答案Acpp float square(float x) { return x * x; } float area = square(2); Bcpp square(float x) { return x * x; } float area = square(2); Ccpp void square(float x) { return x * x; } area = square(2.0); Dcpp void square(float x) { x * x; return; } area = square(2); 提交答案详细解析这题不会 ← 上一题 第 271 / 378 题← → 键切题 下一题 →
下面的语句中,( )正确定义了一个计算浮点数 xxx 的平方(x2=x⋅xx^2=x\cdot xx2=x⋅x)的函数,并成功调用该函数。 填写答案Acpp float square(float x) { return x * x; } float area = square(2); Bcpp square(float x) { return x * x; } float area = square(2); Ccpp void square(float x) { return x * x; } area = square(2.0); Dcpp void square(float x) { x * x; return; } area = square(2); 提交答案详细解析这题不会