fork download
  1. '[.RIsStupid' <- function(x, i) {
  2. class(x) <- "character"
  3. x <- x[i]
  4. class(x) <- "RIsStupid"
  5. x
  6. }
  7.  
  8. '>.RIsStupid' <- function(a,b) {
  9. ifelse( paste0(a, b) > paste0(b, a), TRUE, FALSE)
  10. }
  11.  
  12. '==.RIsStupid' <- function(a, b)
  13. ifelse(a > b || b > a, FALSE, TRUE)
  14.  
  15.  
  16. makeThem <- function(input) {
  17. inputs <- strsplit(input, ' ')[[1]]
  18. class(inputs) <- "RIsStupid"
  19. inputs <- sort(inputs)
  20. cat(c(paste(inputs, collapse = ''), paste(rev(inputs), collapse = '')))
  21. }
  22.  
  23. makeThem("79 82 34 83 69")
  24. makeThem("420 34 19 71 341")
  25. makeThem("17 32 91 7 46")
  26.  
  27.  
Success #stdin #stdout 0.16s 175424KB
stdin
Standard input is empty
stdout
3469798283 8382796934193413442071 714203434119173246791 917463217