TOPIC

1235 - WA %15 - C

rmeneguzzo asked 2 years ago

[EN] Hey everybody. My 1235 code has invalid with WA 15%. Can you help me?

[PT-BR] Olá, pessoal. Meu código 1235 está inválido, com WA 15%. Você consegue me ajudar?

include

include

int main(){ int N, tam, halftam, i; char str[101];

printf("Digite um numero:\n");
scanf("%d", &N);
fflush(stdin);

for(; N>0; N--){
    printf("Digite o string:\n");
    gets(str);

    tam = strlen(str);
    halftam = tam/2;

    for(i=halftam-1; i>=0; i--){
        printf("%c", str[i]);
    }

    for(i=tam-1; i>=halftam; i--){
        printf("%c", str[i]);
    }

    printf("\n");
}

return 0;

}

This topic was solved and cannot recieve new replies.