Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- string catBreed, catGender;
- getline(cin, catBreed);
- cin >> catGender;
- int breedYears =
- catBreed == "Siberian" ? 11 :
- catBreed == "American Shorthair" ? 12 :
- catBreed == "British Shorthair" ? 13 :
- catBreed == "Persian" ? 14 :
- catBreed == "Siamese" ? 15 :
- catBreed == "Ragdoll" ? 16 : 0;
- if (catGender == "f") {
- breedYears++;
- }
- breedYears > 0 ?
- printf("%i cat months", breedYears * 2) :
- printf("%s is invalid cat!", catBreed);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement