| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 157073 | 张浩然 | 书的价格 | C++ | Wrong Answer | 1 MS | 280 KB | 440 | 2026-07-13 14:51:11 |
#include<bits/stdc++.h> using namespace std; struct book{ string name; double jg; }; bool cmp(book a,book b){ if(a.jg>b.jg){ return 1; }else{ return 0; } } int main(){ int n; cin>>n; book x[n]; for(int i=0;i<n;i++){ getline(cin,x[i].name); cin>>x[i].jg; } sort(x+0,x+n,cmp); printf("%.2f, ",x[0].jg); cout<<x[1].name<<endl; printf("%.2f, ",x[n-1].jg); cout<<x[n-1].name<<endl; return 0; }
------Input------
3 Programming in C 0 Programming in VB 1 Programming in Delphi 2
------Answer-----
2.00,Programming in Delphi 0.00,Programming in C
------Your output-----
0.00, 0.00,