Help me in solving START01 problem

My issue

How to solve this problem in R programming language
number ← as.integer(readline())
cat(number)

However, this code is not functioning as expected. It worked correctly when I tested it within the R console, but there may be an issue when executed as a standalone script. Can someone assist in resolving this problem?

My code

number <- as.integer(readline())
cat(number)

Problem Link: START01 Problem - CodeChef

@anon52469913
here is your R solution



a <- as.integer(readLines('stdin',  n = 1, warn = FALSE))
cat(a)
1 Like