Hifipsysta


私信TA

用户名:hifipsysta

访问量:9001

签 名:

等  级
排  名 162
经  验 6818
参赛次数 0
文章发表 132
年  龄 0
在职情况 学生
学  校 SUIBE
专  业

  自我简介:

 

0.0分

4 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区

#include<iostream>
#include<string>
using namespace std;

struct student
{
    string name;
    int age;
    int score;
};

void swap(int &a,int &b)
{
    int temp=a;
    a=b;
    b=temp;
}

void input(student stu[],int n)
{
    for(int i=0;i<n;++i)
    {
        cin>>stu[i].name>>stu[i].age>>stu[i].score;
    }
}

void print(student stu[],int n)
{
    for(int i=0;i<n-1;++i)
    {
        for(int j=0;j<n-1;++j)
        {
            if(stu[j].score>stu[j+1].score)
            {
                string t=stu[j].name;
                stu[j].name=stu[j+1].name;
                stu[j+1].name=t;
2022-09-24 10:45:43
  • «
  • 1
  • »