카타 7급 Easy wallpaper

1 Kotlin[ | ]

2 R[ | ]

wallpaper <- function (l, w, h) {
  numbers<-c("one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty")
  numbers[trunc((l+w)*h*2.3/5.2)+1]
}
wallpaper <- function (l, w, h) {
  switch(ceiling(2.3*h*(l + w) / 5.2) + 1,
    'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten',
    'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen', 'twenty')
}
wallpaper <- function (l, w, h) {
  if(w * h * l == 0) return('zero')
  numbers<-c("one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty")
  numbers[ceiling((l+w)*h*2.3/5.2)]
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}