Advertisement
Guest User

Untitled

a guest
Jan 11th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement