The error is on the line 8 from the end.
x <- c(200, 700, 1000)
if ((x[1] > x[2]) & (x[1] > x[3])) {
if (x[2] > x[3]) {
ord <- c(x[1], x[2], x[3])
}
else {
ord <- c(x[1], x[3], x[2])
}
}
else if ((x[2] > x[1]) & (x[2] > x[3]) {
if (x[1] > x[3]) {
ord <- c(x[2], x[1], x[3])
}
else {
ord <- c(x[2], x[3], x[1])
}
}
else if(x[1] > x[2]){ # I moved the following line here
# (x[1] > x[2]) # this is a mistake
ord <- c(x[3], x[1], x[2])
}
else {
ord <- c(x[3], x[2], x[2])
}
print(ord)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…