|
发表于 2020-5-9 09:25:41
|
显示全部楼层
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- int main(int argc, _TCHAR* argv[])
- {
- string outside;
- cout << "do you like going outside? " << endl;
- getline(cin, outside);
- string food;
- cout << "do you like fish or pork? " << endl;
- getline(cin, food);
- string weather;
- cout << "Do you like sun or rain? " << endl;
- getline(cin, weather);
- if (outside == "yes"&&food == "pork"&&weather == "sun")
- {
- cout << "you are a lot like a dog" << endl;
- }
- else if (outside == "yes"&&food == "pork"&&weather == "rain")
- {
- cout << "you are more like a dog" << endl;
- }
- else if (outside == "yes"&&food == "fish"&&weather == "rain")
- {
- cout << "you are more like a cat" << endl;
- }
- else if (outside == "no"&&food == "fish"&&weather == "rain")
- {
- cout << "you are alot like a cat" << endl;
- }
- else if (outside == "no"&&food == "fish"&&weather == "sun")
- {
- cout << "you are more like a cat" << endl;
- }
- else if (outside == "no"&&food == "pork"&&weather == "sun")
- {
- cout << "you are more like a dog" << endl;
- }
- else{
- cout << "you are a human" << endl;
- }
- return 0;
- }
复制代码 |
|