c语言设计判断三个数最大值的程序#includeint 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);
来源:学生作业帮助网 编辑:六六作业网 时间:2025/02/02 19:08:57
c语言设计判断三个数最大值的程序#includeint 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);
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的上面.
c语言设计判断三个数最大值的程序#includeint 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);
scanf写错了,应写成
scanf("%d %d %d",&x,&y,&z);