Bienvenido a Preguntas omegaUp, donde puedes realizar preguntas y recibir respuestas de otros miembros de la comunidad.

Categorías

0 votos

Por que me manda error de ejecucion, lo probé con varios casos

include <stdio.h>

include

include <string.h>

using namespace std;
int main(){

int a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i1=0,j1=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,num=0,i=0,j=0,cc=0;
int a2=0,b2=0,c2=0,d2=0,e2=0,f2=0,g2=0,h2=0,i2=0,j2=0,k2=0,l2=0,m2=0,n2=0,o2=0,p2=0,q2=0,r2=0,s2=0,t2=0,u2=0,v2=0,w2=0,x2=0,y2=0,z2=0;
cin>>num;

fflush(stdin);

char cadena1[50]= {};
for (cc=0; cc<num; cc++){

gets(cadena1);
fflush(stdin);

a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i1=0,j1=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;
a2=0,b2=0,c2=0,d2=0,e2=0,f2=0,g2=0,h2=0,i2=0,j2=0,k2=0,l2=0,m2=0,n2=0,o2=0,p2=0,q2=0,r2=0,s2=0,t2=0,u2=0,v2=0,w2=0,x2=0,y2=0,z2=0;

i=0;
j=strlen(cadena1)-1;
while(cadena1[i]!=32 || cadena1[j]!=32 )
{

if(cadena1[i]!=32){
if(cadena1[i] == 'a') a++;
if(cadena1[i] == 'b') b++;
if(cadena1[i] == 'c') c++;
if(cadena1[i] == 'd') d++;
if(cadena1[i] == 'e') e++;
if(cadena1[i] == 'f') f++;
if(cadena1[i] == 'g') g++;
if(cadena1[i] == 'h') h++;
if(cadena1[i] == 'i') i1++;
if(cadena1[i] == 'j') j1++;
if(cadena1[i] == 'k') k++;
if(cadena1[i] == 'l') l++;
if(cadena1[i] == 'm') m++;
if(cadena1[i]== 'n') n++;
if(cadena1[i] == 'o') o++;
if(cadena1[i] == 'p') p++;
if(cadena1[i] == 'q') q++;
if(cadena1[i] == 'r') r++;
if(cadena1[i] == 's') s++;
if(cadena1[i] == 't') t++;
if(cadena1[i] == 'u') u++;
if(cadena1[i] == 'v') v++;
if(cadena1[i] == 'w') w++;
if(cadena1[i] == 'x') x++;
if(cadena1[i] == 'y') y++;
if(cadena1[i] == 'z') z++;
i++;
}

if(cadena1[j]!=32){
if(cadena1[j] == 'a') a2++;
if(cadena1[j] == 'b') b2++;
if(cadena1[j] == 'c') c2++;
if(cadena1[j] == 'd') d2++;
if(cadena1[j] == 'e') e2++;
if(cadena1[j] == 'f') f2++;
if(cadena1[j] == 'g') g2++;
if(cadena1[j] == 'h') h2++;
if(cadena1[j] == 'i') i2++;
if(cadena1[j] == 'j') j2++;
if(cadena1[j] == 'k') k2++;
if(cadena1[j] == 'l') l2++;
if(cadena1[j] == 'm') m2++;
if(cadena1[j] == 'n') n2++;
if(cadena1[j] == 'o') o2++;
if(cadena1[j] == 'p') p2++;
if(cadena1[j] == 'q') q2++;
if(cadena1[j] == 'r') r2++;
if(cadena1[j] == 's') s2++;
if(cadena1[j] == 't') t2++;
if(cadena1[j] == 'u') u2++;
if(cadena1[j] == 'v') v2++;
if(cadena1[j] == 'w') w2++;
if(cadena1[j] == 'x') x2++;
if(cadena1[j] == 'y') y2++;
if(cadena1[j] == 'z') z2++;
j--;
}

}

if (a==a2 && b==b2 && c==c2 && d==d2&& e==e2&& f==f2&& g==g2&& h==h2&& i1==i2&& j1==j2&& k==k2&& l==l2&& m==m2&& n==n2&& o==o2&& p==p2&& q==q2&& r==r2&& s==s2&& t==t2&& u==u2&& v==v2&& w==w2&& x==x2&& y==y2&& z==z2) //aca tambien, hasta la z
cout<<"si"<<endl;
else
cout<<"no"<<endl;

}

return 0;
}

por isaac_mallqui (90 puntos)

Por favor ingresa o regístrate para responder a esta pregunta.

...