Advertisement
noor017

Animal

Jun 28th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.25 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char i1[20], i2[20], i3[20];
  6.  
  7.     scanf("%s %s %s", &i1, &i2, &i3);
  8.  
  9.     if(strcmp(i1, "vertebrado")==0)
  10.     {
  11.         if(strcmp(i2, "ave")==0)
  12.         {
  13.             if(strcmp(i3, "carnivoro"))
  14.             {
  15.                 printf("aguia\n");
  16.             }
  17.  
  18.             else if(strcmp(i3, "onivoro"))
  19.             {
  20.                 printf("pomba\n");
  21.             }
  22.  
  23.         }
  24.  
  25.         else if(strcmp(i2, "mamifero"))
  26.         {
  27.             if(strcmp(i3, "onivoro"))
  28.             {
  29.                 printf("homem\n");
  30.             }
  31.  
  32.             else if(strcmp(i3, "herbivoro"))
  33.             {
  34.                 printf("vaca\n");
  35.             }
  36.         }
  37.     }
  38.  
  39.     else if(strcmp(i1, "invertebrado"))
  40.     {
  41.         if(strcmp(i2, "inseto"))
  42.         {
  43.             if (strcmp(i3, "hematofago"))
  44.             {
  45.                 printf("pulga\n");
  46.             }
  47.  
  48.             else
  49.             {
  50.                 printf("lagarta\n");
  51.             }
  52.         }
  53.  
  54.         else
  55.         {
  56.             if (strcmp(i3, "hematofago"))
  57.             {
  58.                 printf("sanguessuga\n");
  59.             }
  60.  
  61.             else
  62.             {
  63.                 printf("minhoca\n");
  64.             }
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement