. you could use a 64bit int <-- best bet for ya
if you scaled this...
. without having to use a large number lib, you could check input and see if it is equal to the max value of int/long/etc and throw an error; "value may* exceed ..."
. you could use a large number lib and just do a comparison, if a > b. throw error based on that.
. you could count the number of integers for the input by reading it in as const char * ("%s" format), and starting with the most significant integer checking each value to see if it ever 'exceeds' using 'atoi()'. throw error based on that.