Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
73527 段文昊 单价最高的书 C++ Compile Error 0 MS 0 KB 588 2024-05-19 12:13:02

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; struct s{ int c; string b; int year; int month; }; int main(){ int n; cin>>n; s a[n]; for(int i=0;i<n;i++){ cin>>a[i].c>>a[i].b>>a[i].year>>a[i].month; } for(int i=0;i<n-1;i++){ for(int j=0;j<n-1;j++){ if(a[j].month/a[j].year<a[j+1].month/a[j+1].year){ s tmp=a[j]; a[j]=a[j+1]; a[j+1]=tmp; }else if(a[j].year==a[j+1].year && a[j].month<a[j+1].month){ swap(a[j],a[j+1]); } } } cout<<a[0].c<<" "<<a[0].b<<" "<<a[0].year<<" "<<a[0].month<<" "; } return 0; }


Run Info:

Main.cc:30:2: error: expected unqualified-id before 'return'
  return 0;
  ^
Main.cc:31:1: error: expected declaration before '}' token
 }
 ^