... how can you declare variables at the beginning/elsewhere in the block of code so that said variables can support letters in this kind of circumstance?
If you want to support letters, you should declare your input as a (c-)string rather than an int.