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. '==.RIsStupid' <- function(a, b)
  12. ifelse(a > b || b > a, FALSE, TRUE)
  13.  
  14.  
  15. makeThem <- function(input) {
  16. inputs <- strsplit(input, ' ')[[1]]
  17. class(inputs) <- "RIsStupid"
  18. inputs <- sort(inputs)
  19. return(c(paste(inputs, collapse = ''), paste(rev(inputs), collapse = '')))
  20. }
  21.  
  22. cat(makeThem("79 82 34 83 69"))
  23. cat(makeThem("420 34 19 71 341"))
  24. cat(makeThem("17 32 91 7 46"))
  25.  
  26.  
Success #stdin #stdout 0.17s 175424KB
stdin
Standard input is empty
stdout
3469798283 8382796934193413442071 714203434119173246791 917463217