这是用函数写的,还有你的程序里好多错误哦
#include <stdio.h> float max(float x,float y) {float z; if(x>y) z=x; else z=y; return z; } void main() {float a,b,c; printf ("please input two numbers (a,b):"); scanf("%f,%f",&a,&b); c=max(a,b); printf("%f,%f,the max is%f\n",a,b,c);
}
嘿嘿,我是处学者帮你整理了一下,现在没啥错误了