반응형
https://www.hackerrank.com/challenges/inherited-code/problem
/* Define the exception here */
class BadLengthException
{
private:
int nameLength;
public:
BadLengthException(int n) : nameLength(n)
{}
virtual int what() const
{
return nameLength;
}
};
반응형
'C++' 카테고리의 다른 글
[HackerRank] Virtual Functions -Medium (0) | 2019.10.28 |
---|---|
[HackerRank] Exceptional Server - Easy (0) | 2019.10.25 |
[HackerRank] Box it! - easy (0) | 2019.10.23 |
[HackerRank] Classes and Objects - Easy (0) | 2019.10.16 |
[HackerRank] Strings - Easy (0) | 2019.10.14 |
댓글