문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. ==개요== ;<nowiki>HR30 Day 17: More Exceptions</nowiki> * https://www.hackerrank.com/challenges/30-more-exceptions/problem {{HR30 헤더}} {{HR30 10-19}} |} ==Java== {{참고|HR30 Day 17: More Exceptions/Java}} <syntaxhighlight lang='Java'> //Write your code here class Calculator { int power(int n, int p) throws Exception { if( n<0 || p<0 ) { throw new Exception("n and p should be non-negative"); } return (int) Math.pow(n, p); } } </syntaxhighlight> ==PHP== {{참고|HR30 Day 17: More Exceptions/PHP}} <syntaxhighlight lang='PHP'> <?php //Enter your code here class Calculator { function power($n,$p) { if( $n<0 || $p<0 ) { throw new Exception("n and p should be non-negative"); } return pow($n, $p); } } </syntaxhighlight> ==Python== {{참고|HR30 Day 17: More Exceptions/Python}} <syntaxhighlight lang='python'> #Write your code here class Calculator(object): def power(self, n, p): if n<0 or p<0: raise Exception("n and p should be non-negative") return n**p </syntaxhighlight> 이 문서에서 사용한 틀: 틀:Ed (원본 보기) 틀:HR30 10-19 (원본 보기) 틀:HR30 헤더 (원본 보기) 틀:언어아이콘 (원본 보기) 틀:언어이미지 (원본 보기) 틀:참고 (원본 보기) HR30 Day 17: More Exceptions 문서로 돌아갑니다.