La funzione 'int strchr(const char *str, char chr)' che trovi in <string.h> restituisce la prima occorrenza del carattere char nella stringa str.
La funzione 'int atoi(const char *str)' in <stdlib.h> trasforma la stringa str in un intero.
Se usi strchr con come secondo argomento uno spazio, riesci a separare le parole e con atoi trasformi i numeri in numeri.