int num=0;
if (a < b) {
if (a < c) {
num = a;
} else {
num = c;
}
} else {
if (b < c) {
num = b;
} else {
num = c;
}
}
return num;
}
代码粘贴一下,帮助有困难的人,我是无相孤君
秋风落叶
评论 (6)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
Zixiao Li
12 十一月 2020, 15:47
可以用这个符号&,代表and
0
null
18 八月 2020, 02:23
int d;
if( a < b)
d = a;
else
d = b;
if( d < c)
return d;
else
return c;
0
null
18 八月 2020, 02:22
需要这么复杂吗?
0
null
14 五月 2020, 10:44
int m = 0;
if (a <= b ){
if (a <= c){
m = a ;
}else{
m =c;
}
}else {
if (b<=c){
m=b;
}else{
m=c;
}
}
return m;
0
carmen77
3 五月 2020, 12:52
这个远原理到底又是什么- - 复制粘贴了,原理还是没学会
遇到 4个数 中找到最小值又不会了。。
0
Shuy
20 十二月 2019, 07:15
I hope you understand english, but try to test it with 1 , 3 , 2. The first if and second if statement would make num = c, which would be wrong.
+1