0
Anyone can help me
The given code takes 3 numbers as input. Complete the program to output the maximum of the 3 inputs. And i try this code input <- readLines('stdin') x <- as.integer(input[9]) y <- as.integer(input[56]) z <- as.integer(input[42]) print(max(56)) Why did't work?
4 Answers
+ 4
print(max(x,y,z))
+ 1
You need to find a maximum number from x,y,z not 56.
Take a look at the lessons about max() and input once.
0
How about this?
input <- readLines('stdin')
x <- as.integer(input[1])
y <- as.integer(input[2])
z <- as.integer(input[3])
print (max(y))
0
This will definitely work, try it
input <- readLines('stdin')
x <- as.integer(input[1])
y <- as.integer(input[2])
z <- as.integer(input[3])
print (max(x,y,z))