早教吧 育儿知识 作业答案 考试题库 百科 知识分享

我想用程序求三个数的中间值,编译时出现errorC2061:syntaxerror:identifier'q'什么意思啊#include"stdafx.h"floatmin3(floatx,floaty,floatz);intmain(intargc,char*argv[]){floata,b,c,min;printf("Input

题目详情
我想用程序求三个数的中间值,编译时出现error C2061: syntax error : identifier 'q'什么意思啊#include "stdafx.h" float min3(float x,float y, float z); int main(int argc, char* argv[]) { float a,b,c, min; printf ("Input 3 numbers a b c:"); scanf ("%f%f%f", &a,&b,&c); min=min3(a,b,c); printf ("The min is: %f\n", min); return 0; } float min3 (float x, float y, float z) { float m,q; if (x>y) m=y; else q=y; if (m>z) return (m); else if q>z q=z; return (q); } 请告诉我怎么改
▼优质解答
答案和解析
float min3 (float x, float y, float z) { float m,q; if (x>y) m=y; else q=y; if (m>z) return (m); else if (q>z) //这里加个括号 q=z; return (q); }