R中是否有等效的构建块
if ($a > $b) {
echo "a is bigger than b";
} elseif ($a == $b) {
echo "a is equal to b";
} else {
echo "a is smaller than b";
}
来自PHP还是Java?
答案 0 :(得分:3)
这不是惯用的,但答案是肯定的:
if (a > b) {
cat("a is bigger than b")
} else if (a == b) {
cat("a is equal to b")
} else {
cat("a is smaller than b")
}