杭电 hdu 3808

Celebration of Stefanie's Wedding:

#include<iostream>
#include<map>
using namespace std;
int main(){
    map<string,int> m;
    typedef map<string,int>::value_type value;
    m.insert(value("Yu Jian",1));
    m.insert(value("Tin O O",2));
    m.insert(value("I Missed",3));
    m.insert(value("Stefanie",4));
    m.insert(value("The Same",5));
    m.insert(value("About",8));
    m.insert(value("Honey Honey",9));
    m.insert(value("Unfinished",10));
    m.insert(value("Hey Jude",11));
    int n;
    cin>>n;
    cin.ignore();
    int t=1;
    while(n--){
        int x;
        cin>>x;
        x%=14;
          
        if(t==1){
            cout<<"Best wishes to Stefanie"<<endl<<endl;
            t=0;
        }
          
        int flag=1;
        map<string,int>::iterator iter;
        for(iter=m.begin();iter!=m.end();++iter){
            if(iter->second==x){
                cout<<iter->first<<endl;
                flag=0;
                break;
            }
        }
        if(flag==1)
            cout<<"When Winter Fades"<<endl;
    }
    return 0;
}


你可能感兴趣的:(ACM,HDU,杭电,3808)