SHARE
TWEET

Untitled

a guest Jan 11th, 2017 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Reading from stdin
  2. #     5
  3. #     4.2 5.4 1.2 5.3 8.9
  4.  
  5. stdin <- file('stdin')
  6. lines <- readLines(stdin)
  7. N <- as.numeric(lines[1])
  8.  
  9. stopifnot(N == as.integer(N))
  10.  
  11. chunks <- strsplit(lines[2], split='\\s+')[[1]]
  12. values <- as.numeric(chunks)
  13.  
  14. close(stdin)
RAW Paste Data
Top