文章
3
粉丝
40
获赞
1
访问
1.6k
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct loggle{
string task;
string shijian;
float haoshi;
};
bool comp(loggle lhs, loggle rhs)
{
if(lhs.haoshi < rhs.haoshi) return true;
else if(lhs.haoshi == rhs.haoshi)
{
if(lhs.shijian < rhs.shijian) return true;
}
return false;
}
int main()
{
loggle a;
vector<loggle> b;
string temp;
while(getline(cin, temp))
{
if(temp == "") break;
a.task = temp;
a.shijian = temp.substr(13,23);
a.haoshi = stod(temp.substr(36, 12));
b.push_back(a);
}
sort(b.begin(), b.end(), comp);
for(int i = 0;i < b.size();i++)
{
cout << b[i].task << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发