Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
73510 | 祝家懿 | 单价最高的书 | C++ | Accepted | 1 MS | 276 KB | 479 | 2024-05-19 11:54:08 |
#include<bits/stdc++.h> using namespace std; struct yl{ int a; string s; int n; int x; }; int main(){ int g; cin>>g; yl w[g]; for(int i=0;i<=g-1;i++){ cin>>w[i].a; cin>>w[i].s; cin>>w[i].n; cin>>w[i].x; } int k=-1; int o=0; int p=0; for(int i=0;i<=g-1;i++){ o=w[i].x/w[i].n; if(k<o){ p=i; k=o; } } cout<<w[p].a<<endl; cout<<w[p].s<<endl; cout<<w[p].n<<endl; cout<<w[p].x<<endl; cout<<k; return 0; }