C++

Happy tickets benchmark

Some countries have integer numbers printed on the transport tickets, for example, in ex-USSR. The ticket is "happy" when the sum of the first half of digits equals to the second one. Then you should eat it and make a wish.

Example:

123456 and 111222 are not happy tickets
123123 and 123222 are the happy tickets

Interface implementations and multiple inheritance in C++

Multiple inheritance of interfaces which are pure abstract classes indeed is not a problem until you need to use the interface implementation in other classes.

Suppose there are two interfaces, the implementation of which will be used in other classes.

Subscribe to RSS - C++