using namespace std;
const int mod=48;
Its the first line of your #include…
Otherwise the program is correct
Or you look your program as
No I don’t think so because it is working fine in compiler.The problem that i think is when 0 comes between the digits.
http://ideone.com/Lfjwtz My AC solution, it is easy to understand the cases that can occur and why your code is failing.