#include <stdio.h>

/** 
 * Strings in C program:
 * Copy two words from one array into two separate arrays, one
 * character at a time. Print the two words with only one space
 * between them.
 * 
 * The two words in data, and the number of spaces, may
 * change. There will not be any spaces before the first word or
 * after the second word. The FIRST word will only contain
 * alphabetical characters. Assume the words will correctly fit in
 * word1 and word2. Assume all whitespace is the space
 * character. Assume all letters are lower case.
 *
 * Example output:
 * % ./a.out 
 * The words are: first more.14$
 * % 
 **/

int main(){

    char word1[10]; /* These will be C strings. */
    char word2[10];
    int i = 0, j = 0, k = 0; /* You may not need three vars */
    
    char data[50] = "first    more.14$"; 

    /* Put the first word from data into word1 as a string */
    while (data[i] != ' '){/*OR (data[i] >= 'a' && data[i] <= 'z')*/
        word1[i] = data[i];
        i++;
    }
    
    word1[i] = '\0';

    /* Get past the spaces (how will you know when you are past?) */

    while (data[i] == ' ') i++;

    /* Put the second word into word2. The second word may contain
       non-alphabetic characters. */

    while (data[i] != '\0'){
        word2[j] = data[i];
        i++;
        j++;
    }

    word2[j] = '\0';

    printf("The words are: %s %s\n", word1, word2);

    return 0;
}
