카타 7급 Sum of Cubes

R[ | ]

sum_cubes <- function(n){
  sum(c(1:n)**3)
}
sum_cubes <- function(n){
  sum(seq(1,n,1)^3)
}
sum_cubes <- function(n){
  n^2 * (n+1)^2 / 4
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}