카타 7급 Looking for a benefactor

1 Kotlin[ | ]

2 R[ | ]

newAvg <- function(arr, newavg){
  ret <- ceiling( (length(arr)+1)*newavg - sum(arr) )
  if( ret < 0 ) stop("ValueError") else ret
}
newAvg <- function(arr, newavg){
  x <- newavg * (length(arr) + 1) - sum(arr)
  if(x <= 0) stop("ValueError")
  ceiling(x)
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}