Advertisement
Spocoman

03. Animal Type

Sep 4th, 2023
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     string animal;
  7.     cin >> animal;
  8.  
  9.     if (animal == "dog") {
  10.         cout << "mammal" << endl;
  11.     }
  12.     else if (animal == "crocodile" || animal == "tortoise" || animal == "snake") {
  13.         cout << "reptile" << endl;
  14.     }
  15.     else {
  16.         cout << "unknown" << endl;
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement