美文网首页
CodeFoeces-987A

CodeFoeces-987A

作者: ss5smi | 来源:发表于2018-06-12 17:30 被阅读0次

题目

原题链接:A. Infinity Gauntlet

题意

六颗宝石对应六种颜色,给出出现的颜色,请列出没出现的宝石的名称。

代码

#include<bits/stdc++.h>
using namespace std;
int main() {
    map<string,string> m;
    map<string,string>::iterator it;
    m["purple"]="Power";
    m["green"]="Time";
    m["blue"]="Space";
    m["orange"]="Soul";
    m["red"]="Reality";
    m["yellow"]="Mind";
    int n;
    string s;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s;
        m[s]="";
    }
    printf("%d\n",6-n);
    for(it=m.begin();it!=m.end();it++){
        if(it->second != ""){
            cout<<it->second<<endl;
        }
    }
    return 0;
}

相关文章

  • CodeFoeces-987A

    题目 原题链接:A. Infinity Gauntlet 题意 六颗宝石对应六种颜色,给出出现的颜色,请列出没出现...

网友评论

      本文标题:CodeFoeces-987A

      本文链接:https://www.haomeiwen.com/subject/wecreftx.html