无标题文章

#德分
#include
using namespace std;
struct fen
{
    int zhun;
    int de;
    int cai;
    int zong;
};
void pai(fen f[],int e)
{
    int i,j;
    fen f5;
    for (i = 0; i < e; i++)
    {
        for (j = i + 1; j < e; j++)
        {
            if (f[i].zong  f[j].zhun)
                        {
                            f5 = f[i];
                            f[i] = f[j];
                            f[j] = f5;
                        }
                    }
                }
            }
        }
    }
    for (i = 0; i < e; i++)
        cout << f[i].zhun << " " << f[i].de << " " << f[i].cai<> n >> l >> h;
    int s=0, y=0, u=0, p=0;
    for (int i = 0; i < n;i++)
    {
        int z, d, c;
        cin >> z >> d >> c;
        if (d >= l&&c >= l)
        {
            sum++;
            if (d >= h&&c >= h)
            {
                f1[s].zhun = z;
                f1[s].de = d;
                f1[s].cai = c;
                f1[s].zong = d + c;
                s++;
            }
            else if (d >= h&&c < h)
            {
                f2[y].zhun = z;
                f2[y].de = d;
                f2[y].cai = c;
                f2[y].zong = d + c;
                y++;
            }
            else if (d < h&&c < h&&c <= d)
            {
                f3[u].zhun = z;
                f3[u].de = d;
                f3[u].cai = c;
                f3[u].zong = d + c;
                u++;
            }
            else
            {
                f4[p].zhun = z;
                f4[p].de = d;
                f4[p].cai = c;
                f4[p].zong = d + c;
                p++;
            }
        }
    }
    cout << sum<

你可能感兴趣的:(无标题文章)