TÓPICO
100 WA - C
augusto_klein perguntou 3 years ago
Estou fazendo todos os testes e me dão como corretos, mas na hora da submissão recebo 100% ERRO. Alguém poderia me ajudar?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char texto[1000];
int i,j,ver,n,cont;
scanf("%d", &n);
for(j=0;j<n;j++){
scanf("%s", texto);
i = 0;
ver = 0;
while(texto[i] != '\0'){
if(texto[i] == ')' && ver == 0){ //CASO FOR O PRIMEIRO CARACTER
ver--;
cont = strlen(texto);
i = cont;
}else if(texto[i] == '('){
ver++;
}else if(texto[i] == ')'){
ver--;
}
i++;
}
if(ver == 0){
printf("correct\n");
}else{
printf("incorrect\n");
}
}
}