萌萌噠表情符號通常由“手”、“眼”、“口”三個主要部分組成。簡單起見,我們假設一個表情符號是按下列格式輸出的:
左手[右手] 現給出可選用的符號集合,請你按用戶的要求輸出表情。
輸入格式:
輸入首先在前三行順序對應給出手、眼、口的可選符號集。每個符號括在一對方括號[]內。題目保證每個集合都至少有一個符號,并不超過10個符號;每個符號包含1到4個非空字符。
之后一行給出一個正整數K,為用戶請求的個數。隨后K行,每行給出一個用戶的符號選擇,順序為左手、左眼、口、右眼、右手——這里只給出符號在相應集合中的序號(從1開始),數字間以空格分隔。
輸出格式:
對每個用戶請求,在一行中輸出生成的表情。若用戶選擇的序號不存在,則輸出“Are you kidding me? @//@”。
輸入樣例: [╮][╭][o][~][/~] [<][>] [╯][╰][^][-][=][>][<][@][⊙] [Д][▽][_][ε][^] … 4 1 1 2 2 2 6 8 1 5 5 3 3 4 3 3 2 10 3 9 3 輸出樣例: ╮(╯▽╰)╭ <(@Д=)/~ o(^ε^)o Are you kidding me? @//@
#include <iostream>#include <vector>#include <stdio.h>using namespace std;int main(){ char em[3][20][10] = {0}; int len[3] = {0}; for(int i = 0; i < 3; i ++){ len[i] = 0; int j = 0; bool flag = false; char ch; while((ch = getchar()) != '/n'){ if(ch == '['){ flag = true; len[i] ++; j = 0; } else if(ch == ']'){ flag = false; } else if(flag){ em[i][len[i]][j ++] = ch; } } } int K; cin >> K; for(int i = 0; i < K; i ++){ int lHand, lEye, mouth, rEye, rHand; cin >> lHand >> lEye >> mouth >> rEye >> rHand; int w = false; if(lHand < 1 || lHand > len[0] || rHand < 1 || rHand > len[0]) w = true; if(lEye < 1 || lEye > len[1] || rEye < 1 || rEye > len[1]) w = true; if(mouth < 1 || mouth > len[2]) w = true; if(w){ cout << "Are you kidding me? @///@" << endl; continue; } cout << em[0][lHand] << "(" << em[1][lEye] << em[2][mouth] << em[1][rEye] << ")" << em[0][rHand] << endl; } return 0;}新聞熱點
疑難解答