二进制“>>”: 没有找到接受“int [5]”类型的右操作数的运算符(或没有可接受的转换)

Topazpeach Topazpeach 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include<iostream>
using namespace std;
struct Student
{
int score[5];
char name[20];
};
int main()
{
Student st[5];
for(int i=0;i<5;i++)
cin>>st[i].name>>st[i].score;
for(int i=0;i<5;i++)
{
for(int j=i+1;j<5;j++)
{
if(st[j].score>st[i].score)
{
Student temp=st[i];
st[i]=st[j];
st[j]=temp;
}
}
}
for(int i=0;i<5;i++)
{
cout<<st[i].name<<st[i].score;}
return 0;
}

第12行总是显示标题所示错误……
...全文
评论 5
收藏 已收藏
分享
返回顶部
Topazpeach
C++ 语言 65,212 成员 250,513 内容