TOPIC

5% error.Help

Eightletters asked 5 months ago

include include

int main() { int i,t; char sh[40],r[40],s[10]="tesoura",p[10]="papel",R[10]="pedra",l[10]="lagarto",sp[10]="Spock";

scanf("%d",&t);

for(i=1;i<=t;i++){
    scanf("%s %s",sh,r);

    printf("Caso #%d: ",i);

    if(strcmp(sh,r)==0) printf("De novo!\n");

    else if((strcmp(sh,s)==0&&strcmp(r,p)==0)||(strcmp(sh,p)==0&&strcmp(r,R)==0)||(strcmp(sh,R)==0 && strcmp(r,l)==0)
        ||(strcmp(sh,l)==0  && strcmp(r,sp)==0)||(strcmp(sh,sp)==0 && strcmp(r,s)==0)||(strcmp(sh,l)==0 && strcmp(r,p)==0)||
        (strcmp(sh,l)==0 &&strcmp(r,p)==0)||(strcmp(sh,p)==0 && strcmp(r,sp)==0)||(strcmp(sh,sp)==0 &&  strcmp(r,R)==0)||
        (strcmp(sh,R)==0 && strcmp(r,s)==0))
         printf("Bazigo!\n");

   else printf("Raj trapaceou!\n");
}

return 0;

}

This topic was solved and cannot recieve new replies.

  • Eightletters replied 5 months ago

    Thanks,mate.Apart from thre mistake that you've shown,I've made a mistake in #7 statement.I've found and solved it.Again thank you for giving time to find the mistake.

  • Eightletters replied 5 months ago

    Still 5% error

  • feodorv replied 5 months ago

             printf("Bazigo!\n");

    It should be

             printf("Bazinga!\n");