Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string animal;
- cin >> animal;
- //dog -> mammal
- //crocodile, tortoise, snake -> reptile
- //others -> unknown
- if (animal == "dog")
- {
- cout << "mammal" << endl;
- }
- else if (animal == "crocodile" || animal == "tortoise" || animal == "snake")
- {
- cout << "reptile" << endl;
- }
- else
- {
- cout << "unknown" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement