int x, y, z;
壹下子聲明了3個int型的變量
但是在定義函數的輸入參數時,後面兩個參數的類型就不能省略了,
int max(int x, y, z);
改為:
int max(int x, int y, int z);
另外,妳在主函數main函數中指定參數是錯誤的,這裏不需要參數:
#include "stdafx.h"
int main ( ) //int a,int b,int c這3個參數不需要
{
int a,b,c; //這3個變量的聲明放在main函數內部
int max(int x,int y,int z);//改為int x,int y,int z
scanf("%d %d %d", &a, &b, &c);
printf("max=%d\n",max(a, b, c));
return 1;
}
int max(int x,int y,int z)//改為int x,int y,int z
{
int temp;
temp=x;
if (x<y)
temp=y;
if (temp<z)
temp=z;
return temp;
}