Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54987 | zhangweiran | 最高分数的学生姓名 | C++ | Accepted | 0 MS | 252 KB | 313 | 2024-11-01 16:33:38 |
#include<iostream> using namespace std; struct node{ string name; double score; }s[100]; int main() { int n,max,max_num; max=-1; cin>>n; for(int i=0;i<n;i++){ cin>>s[i].score>>s[i].name; if(s[i].score>max){ max=s[i].score; max_num=i; } } cout<<s[max_num].name; return 0; }