UVa : 11713


#include <stdio.h>
#include <string.h>

bool is_vowel (char x)
{
    if ( x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u' )
        return true;

    return false;
}

bool check (char x [], char y [])
{
    int len_x = strlen (x);
    int len_y = strlen (y);

    if ( len_x != len_y )
        return false;

    for ( int i = 0; i < len_x; i++ ) {
        if (!is_vowel (x [i]) && x [i] != y [i])
            return false;
    }

    return true;

}

int main ()
{
    int testCase;
    scanf ("%d", &testCase);

    while ( testCase-- ) {
        char first [25];
        char second [25];

        scanf ("%s %s", first, second);

        if ( check (first, second) )
            printf ("Yes\n");
        else
            printf ("No\n");
    }

    return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s