You must at first fetch and parse the input for your variables and than run your algorithm and output.
For simple data input you can use
scanf.
For searching into strings the used function is strtok. Here is some small
tutorial. It is a little weired "old school" function, so take time to understand the usage.
The next needed function is atoi. Here is some
tutorial.
you will need code like this
int value = 0;
value = atoi( szTokBuffer );
in your strtok loop.