文章
111
粉丝
1
获赞
737
访问
21.6k
#include <bits/stdc++.h>
using namespace std;
struct Log{
string line;
string date;
double time;
};
bool cmp(Log a,Log b){
if(a.time == b.time)return a.date < b.date;
return a.time < b.time;
}
int main()
{
vector<Log> log;
string line;
double t;
while(getline(cin,line) && !line.empty()){
string old = line; //原始字符串
stringstream str(line); //分割字符串
string x,y,z,s;
str >> x >> y >> z >> s;
t = stod(s.substr(0,s.find('(')));
log.push_back({old,y+z,t}); //存入vector
}
sort(log.begin(),log...
登录后发布评论
暂无评论,来抢沙发