L1-063 吃鱼还是吃肉 (10 分)

水题。

int h[]={129,130};
int w[]={25,27};

int main()
{
    int T;
    cin>>T;
    while(T--)
    {
        int sex,height,weight;
        cin>>sex>>height>>weight;

        vector<string> res;

        if(height < h[sex])
            res.pb("duo chi yu!");
        else if(height == h[sex])
            res.pb("wan mei!");
        else
            res.pb("ni li hai!");
        
        if(weight < w[sex])
            res.pb("duo chi rou!");
        else if(weight == w[sex])
            res.pb("wan mei!");
        else
            res.pb("shao chi rou!");

        for(int i=0;i<res.size();i++)
            if(i) cout<<' '<<res[i];
            else cout<<res[i];
        cout<<endl;
    }

    //system("pause");
    return 0;
}
原文地址:https://www.cnblogs.com/fxh0707/p/14689534.html