A Map of the Cat CodeForces - 952B(交互式题目)

A Map of the Cat

CodeForces - 952B

题意:给出两张猫图,分别标有normal猫和grumpy猫对人抚摸身上某位置的对应反应;

现在你输出0~9,然后后台系统对你的输出输入猫对数字对应位置的抚摸的感受,

最后要求你输出这个猫是哪一类;

第一次做这种交互式题目,感觉很有意思;

有一点需要注意的是题目标明后台的输入只有小写字母;

    

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int main(){
	string s;
	for(int i=0; i<10; i++){
		cout << i << endl;
		getline(cin, s);
		if(s=="great"||s=="cool"||s=="not bad"||s=="don't touch me"||s=="don't think so"){
			cout << "normal\n";
			return 0;
		}
		else if(s=="don't even"||s=="are you serious"||s=="no way"||s=="worse"||s=="terrible"||s=="go die in a hole"){
			cout << "grumpy\n";
			return 0;
		}
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/sirius_han/article/details/80440854
cat