运行以下代码,在VS2015中运行成功后直接退出,在VC++6.0中“按任何键继续。。。”,为甚么这样?
#include<stdio.h>#include<stdlib.h>intmain(){intmax(intx,inty,intz);inta,b,c;printf("...
#include<stdio.h>
#include<stdlib.h>
int main()
{
int max(int x, int y, int z);
int a, b, c;
printf("Enter numbers:\n");
scanf("%d %d %d", &a,&b,&c);
c = max(a, b, c);
printf("Max is %d.\n", c);
}
int max(int x, int y, int z)
{
int m;
if (x >= y&&x >= z)
m = x;
else if (y >= x&&y >= z)
m = y;
else m = z;
return (m);
} 展开
#include<stdlib.h>
int main()
{
int max(int x, int y, int z);
int a, b, c;
printf("Enter numbers:\n");
scanf("%d %d %d", &a,&b,&c);
c = max(a, b, c);
printf("Max is %d.\n", c);
}
int max(int x, int y, int z)
{
int m;
if (x >= y&&x >= z)
m = x;
else if (y >= x&&y >= z)
m = y;
else m = z;
return (m);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询