Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131053 欧阳俊懿 单价最高的书 C++ Compile Error 0 MS 0 KB 620 2025-09-20 17:23:31

Tests(0/0):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct book{ int id; string n; int s; int z,d; void input(){ cin>>id>>n>>s>>z; d=z/s; } void output(){ cout<<id<<' '<<n<<' '<<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; }


Run Info:

Main.cc:20:1: error: expected initializer before 'int'
 int main(){
 ^