Here is code to solve the problem from some challenge website:
- Uva online judge: http://uva.onlinejudge.org/ usually C, somtimes C++ but also can use java
- NTU online judge: http://acm.csie.org/ntujudge/index.php always C
- checkIO: http://www.checkio.org/ always python