| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 117351 | 万隽宇 | 书的价格 | C++ | Compile Error | 0 MS | 0 KB | 662 | 2025-04-17 19:35:42 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<algorithm> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; struct b{ string m; double J; }; bool c(b x,b y){ reture x.J<y.J; }; int main(){ int n; cjd b[20]; cin>>n; for(int i=0;i<n;i++){ cin>>get(); getline(cin.b[i].name); cin>>b[i].J; } sort(b+0,b+n,c); printf("%.2lf,",b[0],J); cout<<b[0].m<<endl; printf("%.2lf,",b[n-1],J); cout<<b[n-1].m<<endl; return 0; }
Main.cc: In function 'bool c(b, b)':
Main.cc:12:5: error: 'reture' was not declared in this scope
reture x.J>get();
^
In file included from /usr/include/c++/5/algorithm:60:0,
from Main.cc:4:
/usr/include/c++/5/utility:147:5: note: candidate: template constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(std::pair<_Tp1, _Tp2>&)
get(std::pair<_Tp1, _Tp2>& __in) noexcept
^
/usr/include/c++/5/utility:147:5: note: template argument deduction/substitution failed:
Main.cc:19:18: note: candidate expects 1 argument, 0 provided
cin>>get();
^
In file included from /usr/include/c++/5/algorithm:60:0,
from Main.cc:4:
/usr/include/c++/5/utility:152:5: note: candidate: template constexpr typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&& std::get(std::pair<_Tp1, _Tp2>&&)
get(std::pair<_Tp1, _Tp2>&& __in) noexcept
^
/usr/include/c++/5/utility:152:5: note: template argument deduction/substitution failed:
Main.cc:19:18: note: candidate expects 1 argument, 0 provided
cin>>get();
^
In file included from /usr/include/c++/5/algorithm:60:0,
from Main.cc:4:
/usr/include/c++/5/utility:157:5: note: candidate: template constexpr const typename std::tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type& std::get(const std::pair<_Tp1, _Tp2>&)
get(const std::pair<_Tp1, _Tp2>& __in) noexcept
^
/usr/include/c++/5/utility:157:5: note: template argument deduction/substitution failed:
Main.cc:19:18: note: candidate expects 1 argument, 0 provided
cin>>get();
^
Main.cc:20:21: error: 'std::istream {aka class std::basic_istream}' has no member named 'b'
getline(cin.b[i].name);
^
Main.cc:21:15: error: expected primary-expression before '[' token
cin>>b[i].J;
^
Main.cc:23:11: error: expected primary-expression before '+' token
sort(b+0,b+n,c);
^
Main.cc:23:15: error: expected primary-expression before '+' token
sort(b+0,b+n,c);
^
Main.cc:24:22: error: expected primary-expression before '[' token
printf("%.2lf,",b[0],J);
^
Main.cc:24:26: error: 'J' was not declared in this scope
printf("%.2lf,",b[0],J);
^
Main.cc:25:12: error: expected primary-expression before '[' token
cout<