I have attempted the problem 'SMALL' from SPOJ http://www.spoj.com/problems/SMALL/1. Here http://ideone.com/oPuOvC3) is the code.
It works fine on CodeBlocks but gives runtime error on ideone, due to overflow.
For example, there is no output for inputs like 5000 or 10000. How do I correct this?
P.S. I've just recently started coding in C++ having knowledge only in C so suggestions on making the code 'cleaner' will be helpful.
created
last reply
- 1
reply
- 491
views
- 2
users
- 2
links