main()
{ int z;
if (x>y)
z=x;
else
z=y;
return(z);
}
main()
{
int n1,n2;
printf(“input the frist number:”)
scanf(“%d”,&n1);
printf(“nput the second number:”)
scanf(“%d”,&n2);
printf(“max=%d\n”,max(n1,n2));
}
>> 本文固定链接: http://www.vcgood.com/archives/1404
#include <stdio.h>
int max(int x,int y)
{
int z;
if (x>y)
z=x;
else
z=y;
return(z);
}
main()
{
int n1,n2;
printf(“input the frist number:”);
scanf(“%d”,&n1);
printf(“input the second number:”);
scanf(“%d”,&n2);
printf(“max=%d\n”,max(n1,n2));
}
基本功太差!
#include <stdio.h>
int max(int x,int y)
{
int z;
if (x>y)
z=x;
else
z=y;
return(z);
}
int main(void)
{
int n1,n2;
printf(“input the frist number:”);
scanf(“%d”,&n1);
printf(“input the second number:”);
scanf(“%d”,&n2);
printf(“max=%d\n”,max(n1,n2));
retutn 0;
}
一个是主函数,一个是自定义函数。要有区别的