1052 卖个萌(测试点1,2)


solution

  • 想要输出\需要用\\才能输出,即
cpp 复制代码
cout << "Are you kidding me? @\\/@" << endl;
  • 测试点1,2:输入序号小于1的非法情况
cpp 复制代码
#include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
	string s, ans, t;
	int k, cnt1 = 1, cnt2 = 1, cnt3 = 1, lh, rh, le, re, m;
	map<int, string> hands, eyes, mouths;
	for(int i = 0; i < 3; i++){
		getline(cin, s);
		for(int j = 0; j < s.size(); j = k + 1){
			if(s[j] == '['){
				for(k = j; s[k] != ']'; k++);
				if(i == 0) hands[cnt1++] = s.substr(j + 1, k - j - 1); 
				else if(i == 1) eyes[cnt2++] = s.substr(j + 1, k - j - 1);
				else mouths[cnt3++] = s.substr(j + 1, k - j - 1);
			}
			else k = j;
		}
	}
	cin >> k;
	while(k--){
		cin >> lh >> le >> m >> re >> rh;
		if(lh >= cnt1 || rh >= cnt1 || le >= cnt2 || re >= cnt2 || m >= cnt3 || lh <= 0 || le <= 0 || m <= 0 || re <= 0 || rh <= 0) cout << "Are you kidding me? @\\/@" << endl;
		else cout << hands[lh] + "(" + eyes[le] + mouths[m] + eyes[re] + ")"+ hands[rh] << endl;
	}
	return 0;
} 
相关推荐
NAGNIP1 小时前
一文搞懂机器学习中的特征降维!
算法·面试
NAGNIP2 小时前
一文搞懂机器学习中的特征构造!
算法·面试
Learn Beyond Limits2 小时前
解构语义:从词向量到神经分类|Decoding Semantics: Word Vectors and Neural Classification
人工智能·算法·机器学习·ai·分类·数据挖掘·nlp
你怎么知道我是队长2 小时前
C语言---typedef
c语言·c++·算法
Qhumaing4 小时前
C++学习:【PTA】数据结构 7-1 实验7-1(最小生成树-Prim算法)
c++·学习·算法
Z1Jxxx5 小时前
01序列01序列
开发语言·c++·算法
丝斯20116 小时前
AI学习笔记整理(42)——NLP之大规模预训练模型Transformer
人工智能·笔记·学习
汽车仪器仪表相关领域7 小时前
全自动化精准检测,赋能高效年检——NHD-6108全自动远、近光检测仪项目实战分享
大数据·人工智能·功能测试·算法·安全·自动化·压力测试
Doro再努力7 小时前
【数据结构08】队列实现及练习
数据结构·算法