카타 8급 Determine offspring sex based on genes XX and XY chromosomes

1 C++[ | ]

std::string chromosomeCheck(std::string sperm) {
   return (sperm == "XX") 
       ?  "Congratulations! You're going to have a daughter."
       :  "Congratulations! You're going to have a son.";
}
std::string chromosomeCheck(std::string sperm) {
  if(sperm.at(1) == 'Y') return "Congratulations! You're going to have a son.";
  return "Congratulations! You're going to have a daughter.";
}

2 PHP[ | ]

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