Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118132 万隽宇 书的价格 C++ Accepted 1 MS 272 KB 649 2025-04-24 18:38:24

Tests(4/4):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<algorithm> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct bo{ string m; double J; }b[20]; bool c(bo x,bo y){ return x.J>y.J; } int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin.get(); getline(cin,b[i].m); cin>>b[i].J; } sort(b+0,b+n,c); printf("%.2lf,",b[0].J); cout<<b[0].m<<endl; printf("%.2lf,",b[n-1].J); cout<<b[n-1].m<<endl; return 0; }