社区讨论
help!!!
B2125最高分数的学生姓名参与者 2已保存回复 1
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 1 条
- 当前快照
- 1 份
- 快照标识符
- @m459m5a6
- 此快照首次捕获于
- 2024/12/01 15:13 去年
- 此快照最后确认于
- 2025/11/04 13:30 4 个月前
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
struct info{
int score;
char name[30];
}people[100];
int n,high=0;
string hname;
cin>>n;
for(int i=0;i<n;i++){
cin>>people[i].name>>people[i].score;
}
for(int i=0;i<n;i++){
if(people[i].score>=high){
high=people[i].score;
hname=people[i].name;
}
}
cout<<hname;
return 0;
}
help!!!
回复
共 1 条回复,欢迎继续交流。
正在加载回复...