Based on the error, the compiler thinks you are using the octal numeric system (base-8). The only valid digits you can use in octal representation of values are 0 through 7. So you can not use 8 and 9 ...
It runs for me as well (g++). Perhaps the online submission judge expects some format that you are not using. Like a separate main.cpp file, or two files for each class definition ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results