Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131051 林嘉乐 单价最高的书 C++ Accepted 1 MS 284 KB 416 2025-09-20 17:21:38

Tests(2/2):


Code:

#include<bits/stdc++.h> using namespace std; struct book{ int c; string b; int s; int z,d; void input(){ cin>>c>>b>>s>>z; d=z/s; } void output(){ cout<<c<<" "<<b<<" "<<s<<" "<<z<<" "<<d<<endl; } }a[101]; int main() { int n; cin>>n; book maxn={0," ",0,0,0}; for(int i=0;i<n;i++){ a[i].input(); if(a[i].d>maxn.d){ maxn=a[i]; } } maxn.output(); return 0; }