Created
December 17, 2017 12:26
-
-
Save saraswatmks/b21ac30c65485828e11b0a31ae6b4139 to your computer and use it in GitHub Desktop.
stdin,stdout in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
con = file('stdin', open='r') | |
inputs <- readLines(con) | |
n <- inputs[[1]] | |
n1 <- inputs[[2]] | |
n1 <- unlist(strsplit(n1, ' ')) | |
n1 <- as.integer(as.factor(n1)) | |
n1 <- n1[length(n1):1] | |
cat(n1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment