文章
20
粉丝
0
获赞
51
访问
1.4k
1.pair<xx,xx>记录double值和小数位数
2.字符串查找不到:==string::npos
#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<string>s;
int n;
cin >> n;
int comma_pos = 0;
for (int i = 0; i < n; i++)
{
string c;
cin >> c;
s.push_back(c);
}
priority_queue < pair<double, int>, vector < pair<double, int>>, greater<pair<double, int>>> q;
for (vector<string>::iterator it = s.begin(); it != s.end(); it++)
{
if ((*it).find(".") != string::npos)
q.push({ stod(*it),(*it).length() -...
登录后发布评论
暂无评论,来抢沙发