title: What is the problem or What's wrong with this code (Uri 1049 question)?
body: <p>this code compiles successfully but after getting the first input, it terminates. </p>
  
  <p>I tried to solve this for several hours but couldn't find the actual problem.</p>
  
  <p>Does this problem occurring for strcmp command? i am trying to solve <strong>uri 1049</strong> no problem and i wrote this but it isn't working. the problem link <a href="https://www.urionlinejudge.com.br/judge/en/problems/view/1049" rel="nofollow noreferrer">https://www.urionlinejudge.com.br/judge/en/problems/view/1049</a></p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
  
  char input[10],      
  first1[10]="vertebrado",
  first2[10]="invertebrado",
  seco1[10]="ave",
  seco2[10]="mamifero",
  seco3[10]="inesto", 
  seco4[10]="anelideo",
  thi1[10]="carnivoro",
  thi2[10]="onivoro",
  thi3[10]="onivoro",
  thi4[10]="herbivoro",
  thi5[10]="hematofago",
  thi6[10]="herbivoro",
  thi7[10]="hematofago",
  thi8[10]="onivoro";
  scanf("%s",&amp;input);
  
  if(strcmp(input,first1)==0)
  {
    scanf("%s",&amp;input);
  
    if(strcmp(seco1,input)==0)
    {
       scanf("%s",&amp;thi1);
       if(strcmp(input,thi1))
       {
          printf("aguia");
       }
       else if(strcmp(input,thi2)==0)
       {
         printf("pomba");
       }
  
       }
         else if(strcmp(seco2,input)==0)
       {
          scanf("%s",input);
  
          if(strcmp(input,thi3)==0)
          {
             printf("homem");
          }
          else if(strcmp(input,thi4)==0)
          {
             printf("vaca");
          }
        }
     }
     else if(strcmp(input,first2)==0)
     {
       scanf("%s",&amp;input);
       if(strcmp(input,seco3)==0)
       {
          scanf("%s",&amp;input);
  
          if(strcmp(input,thi5)==0)
          {
              printf("pulga");
          }
          else if(strcmp(input,thi6)==0)
          {
               printf("lagarta");
          }
  
         }
         else if(strcmp(input,seco4)==0)
         {
            scanf("%s",&amp;input);
            if(strcmp(input,thi7)==0)
            {
               printf("sanguessuga");
            }
            else if(strcmp(input,thi8)==0)
            {
               printf("minhoca");
            }
          }
  
        }
  }
  </code></pre>