Hello. I'm new here, and just starting. I'm working on the simple first problem, TEST - Life, the Universe, and Everything. My code is R. My program works fine in R Studio when I use readline(). But that is in interactive mode, where the console is waiting for me to enter a value.
In Sphere Online Judge, the mode is non-interactive, I believe. When the code runs, my output is null. Can someone give me a pointer on how to properly get data input? My current code below:
n <- 0
while(n != 42) {
n <- as.numeric(readline())
if(n == 42) break
print(n)
}
It appears I'll need a different input call for the Sphere script to run. Investigating readLines(), cat(), scan(). Any advice appreciated.