#include<stdio.h>
void main()
{
int max(int x,int y,int z);
int a,b,c,h;
scanf("%d,%d,%d",&a,&b,&c);
h=max(a,b,c);
printf("max=%d\n",h);
}
int max(int x,int y,int z);
{
int e,f;
if(x>y)e=x;
else e=y;
if(e>z)f=e;
else f=z;
return(f);
}
编译结果
D:\Program Files (x86)\DEV-CPP\Examples\未命名1.c In function `main':
3 D:\Program Files (x86)\DEV-CPP\Examples\未命名1.c [Warning] return type of 'main' is not `int'
At top level:
11 D:\Program Files (x86)\DEV-CPP\Examples\未命名1.c syntax error before '{' token