C语言帮忙找出下列各段程序中的语法和逻辑错误.main(){int num1,num2;printf("Please enter two numbers:");scanf("%d%d",&num1,&num2);printf("Max=%d,Min=%d\n",max_min(int num1,int numb2));}int max_min(number1,number2){int max,min;max=nu

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 13:55:11
C语言帮忙找出下列各段程序中的语法和逻辑错误.main(){int num1,num2;printf(
xTjA~ATjE}BY:U@lVѤFDMKa5U_fE6X-93ߜs;L |btv2UaJZ*W"o77Y>6Q1B=n&MFxLF$%"ф$- /Dwv(pӛκ;oF(NϨ;ϣn1BS3Aqӏ:MB׷0lsgٰV.e&ΟcMMk[Dӝ+Ls.if~},PIz007ӊ`W){FVY1ӖVBfUzFo_/T94ճ^߸nZV{#AuPSe}ѯoRJL d|0 eQ7,lɜɜNc\ Hⅱ?DbT//A--{n4(aU}jz'|@F1-,1&(fcj$ 4؏첞 o5yZ\_0nf>~wD>]%o

C语言帮忙找出下列各段程序中的语法和逻辑错误.main(){int num1,num2;printf("Please enter two numbers:");scanf("%d%d",&num1,&num2);printf("Max=%d,Min=%d\n",max_min(int num1,int numb2));}int max_min(number1,number2){int max,min;max=nu
C语言帮忙找出下列各段程序中的语法和逻辑错误.
main()
{
int num1,num2;
printf("Please enter two numbers:");
scanf("%d%d",&num1,&num2);
printf("Max=%d,Min=%d\n",max_min(int num1,int numb2));
}
int max_min(number1,number2)
{
int max,min;
max=number1>number2?number1:number2;
min=number1>number2?number2:number2;
return(max);
return(min);
}

C语言帮忙找出下列各段程序中的语法和逻辑错误.main(){int num1,num2;printf("Please enter two numbers:");scanf("%d%d",&num1,&num2);printf("Max=%d,Min=%d\n",max_min(int num1,int numb2));}int max_min(number1,number2){int max,min;max=nu
main()
{
int num1,num2;
printf("Please enter two numbers:");
scanf("%d%d",&num1,&num2);
printf("Max=%d,Min=%d\n",max_min(int num1,int numb2)); //里面是函数调用吗?看着有点象是声明啊,调用实参不用加类型名吧
}
int max_min(number1,number2) //形参没定义类型
{
int max,min;
max=number1>number2?number1:number2;
min=number1>number2?number2:number2;
return(max);
return(min); //返回值只能有1个,第二个执行不到的
}
改:将输出改在函数中,避免只能返回一个值的问题
main()
{
void max_min(int num1,int numb2);//声明函数
int num1,num2;
printf("Please enter two numbers:");
scanf("%d%d",&num1,&num2);
max_min(num1,numb2);
}
void max_min(int number1,int number2)
{
int max,min;
max=number1>number2?number1:number2;
min=number1>number2?number2:number2;
printf("Max=%d,Min=%d\n",max,min);
}