Beecrowd 1049 Animal Solution

Animal

Introduction

In this guide, we will be discussing the Beecrowd 1049 Animal problem and providing a detailed solution in C, C++, C++, and Python. Our goal is to help readers understand the problem, provide a clear and concise solution, and offer tips on how to improve their programming skills.

URI(Beecrowd ) 1049 Animal Problem

The Beecrowd 1049 Animal problem is a popular programming problem that requires programmers to write a program that accepts three strings as input and outputs a specific animal based on the input. The first input string represents the animal’s class, the second input string represents the animal’s order, and the third input string represents the animal’s species.

Solution in CPP

#include<iostream>
#include<string>
using namespace std;
int main()
{
    string a,b,c;
    getline(cin,a);
    getline(cin,b);
    getline(cin,c);

    if(a=="vertebrado")
    {
        if(b=="ave")
        {
            if(c=="carnivoro")
                cout<<"aguia"<<endl;
            else
            {
                cout<<"pomba"<<endl;
            }
        }
        else if(b=="mamifero") {
            if(c=="onivoro")
        {
            cout<<"homem"<<endl;
        }
        else
        {
            cout<<"vaca"<<endl;
        }
        }
    }
    else if(a=="invertebrado") {
        if(b=="anelideo")
Beecrowd 1049 Animal Solution

Previous problem:URI Bee Crowd 1095: How to Solve the Sequence IJ-1 Problem

2 thoughts on “Beecrowd 1049 Animal Solution”

Leave a Comment