2 条题解

  • 2
    @ 2024-12-6 16:47:57
    #include<bits/stdc++.h>
    using namespace std;
    struct niuma{
    	char name[20];
    	int score;
    };
    int main()
    {
    	niuma stu[1000];
    	int n;
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		cin>>stu[i].name;
    		cin>>stu[i].score;
    	}
    	for(int i=1;i<=n;i++)
    	{
    		for(int j=1;j<=n-1;j++)
    		{
    			if(stu[j].score<stu[j+1].score)
    			swap(stu[j],stu[j+1]);
    		}
    	}
    	for(int i=1;i<=n;i++)
    	{
    		cout<<stu[i].name<<" ";
    		cout<<stu[i].score<<endl;
    	}
    	return 0;
    }
    
    • @ 2024-12-6 16:48:29

      五瓦主播我是你粉丝啊

    • @ 2024-12-7 13:22:19

      牛啊主播

信息

ID
214
时间
1000ms
内存
256MiB
难度
6
标签
递交数
48
已通过
15
上传者