/*用函数编程计算量正整数的最大值*/
#include <stdio.h>
#include <stdl#ib.h>int max(int a,int b)
{
if(a<b) printf("max=%d",b);
else printf("max=%d",a);
}
int main()
{
int a,b;
printf("输入两个正整数;");
scanf("%d%d",&a,&b);
max(a,b);
return 0;
}
知识点
1.调用函数,用条件语句判断最大值
心得体会
1.学会使用函数求两个整数的最大值