Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
38679 | 于欣妍 | 书的价格 | C++ | Accepted | 1 MS | 276 KB | 421 | 2022-09-17 09:07:13 |
#include<iostream> #include<string> #include<iomanip> using namespace std; int main(){ int n; cin>>n; getchar(); string s1,s2,tmp; double max=0,min=999999.0,x; while(n--){ getline(cin,tmp); cin>>x; getchar(); if(x>max){ max=x;s1=tmp; } if(x<min){ min=x;s2=tmp; } } cout<<fixed<<setprecision(2)<<max<<","<<s1<<endl; cout<<fixed<<setprecision(2)<<min<<","<<s2; return 0; }