文章

71

粉丝

97

获赞

5

访问

16.3k

头像
数组排序为什么不对
我要提问
发布于2024年3月20日 17:57
阅读数 157

#include<iostream>
#include<cstring>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;

const int maxn = 10000 + 5;
vector<int> v;

int getnumber(string str,int &index) {
    int number = 0;
    while (isdigit(str[index])) {
        number = 10 * number + str[index] - '0';
        index++;
    }
    return number;

}

int main() {
    string str;
    while (cin>>str) {
        int m = str.size();
        int index = 0;
        v.clear();
        v.push_back(-1);
        while(index<m) {
          ...

登录查看完整内容


登录后发布评论

2 条评论
snake
2024年3月20日 19:25

貌似改对了

赞(0)

DestinyCares+++ : 回复 snake: 忘记了一开始加了一个元素

2024年3月21日 13:44