文章

93

粉丝

56

获赞

263

访问

18.8k

头像
字符串排序3 题解:暴力结构体(无容器)
P1261 北京大学机试题
发布于2025年3月14日 20:04
阅读数 228

#include <bits/stdc++.h>
using namespace std;

struct node
{
    string str;
    int cd;
}jilu[10005];

bool cmp(node a,node b)
{
    return a.cd<b.cd;
}

int main()
{
    int n;
    while(cin>>n)
    {
        memset(jilu,0,sizeof(jilu));
        int count=0;
        while(n--)
        {
            string str;
            if(count==0)cin.ignore(numeric_limits<streamsize>::max(), '\n');
            getline(cin,str);
            if(str=="stop")goto label;
            else
    ...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发