Reposting because my first post was no good. I have a question that I'm not really sure how to do. I know the process I'm going for, but am not totally sure how to scan a string into an array so that each character/integer is scanned into a independent element of the array. I'll post the question and the code I have so far, and any help would be appreciated. 

Question:

Assume that we have a pattern like the following: ([n][letter])+ in which n is an integer number and letter is one of the lowercase letters from a-z. For example, 2a and 3b are valid expressions based on our pattern. Also, “+” at the end of the pattern means that we have at least one expression (string) or more than one expression attached. For instance, 2a4b is another valid expression which is matched with the pattern. In this question, we want to convert these valid expressions to a string in which letters are repeated n times.

o Read an expression (string) from user and print the converted version of the expression in the output.

o Check if input expression is valid. For example, 2ab is not a valid expression. If the expression is not valid, print “Invalid” in the output and ask user to enteranother expression.

o Sample input1 = “2a”, output = aa

o Sample input2 = “2a3b”, output = aabbb

o You will receive extra credit if you briefly explain what concept or theory you can use to check whether an expression is valid or not.

What I have so far:

```
#include <stdio.h>

int main()

{
    int size, i, j;
    char pattern[20];
    char vowel[20];
    int count[20];
    printf("Please enter your string: ");
    gets(pattern);
    size = strlen(pattern);

    for(i=0; i<size; i++)
        if((i+1)%2  == 0)
            vowel[i] = pattern[i];
        else if((i+1)%2 != 0)
            count[i] = pattern[i];

    for(i=0; i<size/2; i++);
        for(j=0; j<count[i]; j++)
            printf("%s", vowel[i]);
}

```