For this problem you will probably need a map or a hash_map to
maintain the count of each animal. Such a map can be used like this

#include <cstdio>
#include <string>
#include <unordered_map>

using namespace std;

char animal[1001] ;
unordered_map<string,int> animalCount ;

// ...

   
    scanf("%[^\n]\n",animal); // reads one animal
    animalCount[animal]++; // update count
    // note that this works with animal of type char*
    // with an implicit type conversion to string. This
    // also works when we encounter an animal for the first 
    // time as 0 is the default int value for an unknown key

