TOPIC

Ajuda Caso de Testes- C

Andel Vitório asked 10 months ago

Não consigo entender o porquê de está dando 100% de erro, sendo que os casos de teste que usei deram a saida esperada.

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

#define MAXS 10005

int main (void)
{
    char vowells[MAXS];
    char str[MAXS];

    while (gets(vowells))
    {
        if (!strcmp(vowells, " "))
            break;

        gets(str);
        int ans = 0;
        int i, j;

        for (i = 0; i < strlen(vowells); i++)
            for (j = 0; j < strlen(str); j++)
                if (str[j] == vowells[i])
                    ans++;

        printf("%d\n", ans);
    }

    return 0;
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.