#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
int member(char *,struct cell *);/*条件2*/
 
struct cell{/*条件1*/
        char animal[20];
        struct cell *next;
};
struct cell *listhead;
 
int main(){
        char animal[20];
 
        struct cell ani1;
        listhead = &ani1;
        strcpy(ani1.animal,"rat");
          
        struct cell ani2;
        ani1.next = &ani2;
        strcpy(ani2.animal,"cat");
        
        struct cell ani3;
        ani2.next = &ani3;
        strcpy(ani3.animal,"dog");
          
        struct cell ani4;
        ani3.next = &ani4;
        strcpy(ani4.animal,"elephant");
        
        struct cell ani5;
        ani4.next = &ani5;
        strcpy(ani5.animal,"horse");
        
        struct cell ani6;
        ani5.next = &ani6;
        strcpy(ani6.animal,"bat");
        
        struct cell ani7;
        ani6.next = &ani7;
        strcpy(ani7.animal,"hamster");
        ani7.next = NULL;
          
        while(strcmp(animal,"00") != 0){
          printf("動物名を英語で入力して下さい。(00で終了)-->");
          scanf("%s",animal);
		if(member(*animal,*next) = 1){
                        printf("%sは存在します。\n",animal);
                }else if(member(*animal,*next) = 0){
                         printf("%sは存在しません。\n",animal);
                }
                if(strcmp(animal,"00") = 0){
                        printf("終了します。\n");
                        return 0;
                }



        }

}


int member(char *animal,struct cell *next){
	if(strcmp(ani1.animal,"rat") == 0){
		return 1;
	}else if(strcmp(ani2.animal,"cat"){
		return 1;
	}else if(strcmp(ani3.animal,"elephant"){
		return 1;
	}else if(strcmp(ani4.animal,"horse"){
		return 1;
	}else if(strcmp(ani5.animal,"bat"){
		return 1;
	}else if(strcmp(ani6.animal,"hamster"){
		return 1;
	}else{
		return 0;
	}
}