文章
8
粉丝
0
获赞
22
访问
7.4k
 
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>
using namespace std;
struct node
{
    int bit;
    int num;
};
bool com(const node &a, const node &b)
{
    if (a.bit == b.bit)
        return a.num < b.num;
    return a.bit > b.bit;
}
int main()
{
    vector<node> p;
    int n;
    // 逐个读取整数
    while (scanf("%d",&n) != EOF)
    {
        int bit = 0;
        int temp = n;
        while (temp)
        {
            bit++;
            temp /= 10;
        }
        p.push_back({bit, n});
    }
    // 排序
    sort(p.b...
登录后发布评论
暂无评论,来抢沙发