카타 8급 Parse nice int from char problem

1 C[ | ]

int getAge(const char *inputString) {
    return *inputString - 48;
}
int getAge(const char *inputString) {
    return *inputString - '0';
}
int getAge(const char *inputString) {
    return inputString[0] -'0';
}

2 PHP[ | ]

function getAge($response) :int {
  return intval($response);
}
function getAge($response) :int {
  return (int) $r;
}
function getAge($response) {
  return 0+$response;
}
function getAge($response) {
  return 1*$response;
}
function getAge($response) {
  return +$response;
}
function getAge($response) {
  return (int)$response{0};
}
function getAge($response) {
  return $response[0];
}
function getAge($response) {
  return number_format($response);
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}