#include<stdio.h>
int GetMax(int a,int b);
int main ()
{
int x,y,max;
printf("Inputx,y:");
scanf("%d%d",&x,&y);
max=GetMax(x,y);
printf("max=%d\n",max);
return 0;
}
int GetMax(int m,int n)
{
if(m>=n)
return m;
else
return n;
}
运行结果:
知识点:
1.学会函数参数的调用;
2双分支控制语句的使用。
心得体会:
1.有的函数没有返回值;
2.main()可以有标准参数和返回值。