我尝试构建此代码并创建可以在正确打印后打印的错误。我有以下代码:
<?php
$A=3;
$B=10;
$C=5;
if ($A<=$B){
if($C<=$A){
echo $C,"</br>",$A,"</br>",$B;
}
if($B<=$C){
echo $A,"</br>",$B,"</br>",$C;
}
else {
echo $A,"</br>",$C,"</br>",$B;
}
}
if ($C<=$B){
echo $C,"</br>",$B,"</br>",$A;
if ($C<=$A){
echo $B,"</br>",$C,"</br>",$A;
}
else{
echo $B,"</br>",$A,"</br>",$C;
}}
?>
我以这个为答案:
3
5
105
10
3
代替
3
5
10
必须打印的 我该如何解决这个问题?
答案 0 :(得分:1)
尝试此代码,您已经忘记了其他代码:
$A=3;
$B=10;
$C=5;
if ($A<=$B){
if($C<=$A){
echo $C,"</br>",$A,"</br>",$B;
}
if($B<=$C){
echo $A,"</br>",$B,"</br>",$C;
}
else {
echo $A,"</br>",$C,"</br>",$B;
}
}
else {
if ($C<=$B){
echo $C,"</br>",$B,"</br>",$A;
}
if ($C<=$A){
echo $B,"</br>",$C,"</br>",$A;
}
else {
echo $B,"</br>",$A,"</br>",$C;
}
}