카타 8급 To square(root) or not to square(root)

1 C[ | ]

int* squareOrSquareRoot(int* array, int length) {
  int res[length];
  for(int i=0; i<length; i++) {
    int rt = sqrt(array[i]);
    if(rt*rt==array[i]) res[i]=rt;
    else res[i] = array[i]*array[i];
  }
  return res;
}

2 PHP[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}