He has already decided he is not going to use it. He can input a set of arguments at once with scanf. No idea whyso you don't need to use scanf right?
He wasn't aware of what he really needs. He just found a code written for something else and wanted to modify that for his requirement.what you need is to write your own lexer to parse it.
Though the inline process is a DFSA, for such small algos, it is not good to get complicated with them. FSAs are usually used when complicated logic is involved and handling them precisely is needed. So for Ghost (I remember he is a student if memory is correct) I also think he should write a pseudo code for his algorithm first. Without knowing what he needs, modifying someone's code is not going to work.There is something called Finite State Machines for that.