问题描述:
c语言设计判断三个数最大值的程序
#include
int max(int a,int b)
{
if(a>b)
return a;
else
return b;
}
int main()
{
int x,y,z,m,u;
scanf("%d%d%d\n",&x,&y,&z);
m=max(x,y);
u=max(m,z);
printf("the biggest number is %d.",u);
getchar();
return 0;
}
请问错在哪里,为什么输不出结果.getchar();在printf的上面.
#include
int max(int a,int b)
{
if(a>b)
return a;
else
return b;
}
int main()
{
int x,y,z,m,u;
scanf("%d%d%d\n",&x,&y,&z);
m=max(x,y);
u=max(m,z);
printf("the biggest number is %d.",u);
getchar();
return 0;
}
请问错在哪里,为什么输不出结果.getchar();在printf的上面.
问题解答:
我来补答展开全文阅读