| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 140537 | 郝王骏程 | 吃巧克力 | C++ | Compile Error | 0 MS | 0 KB | 391 | 2025-12-15 20:56:13 |
#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; int main(){ int a[21]={1,1,2,3},b; cin>>b; for(int i=4;i<=b;i++){ a[i]=a[i-1]+a[i-2]; } cout<a[b]; return 0; }
Main.cc: In function 'int main()':
Main.cc:14:9: error: no match for 'operator<' (operand types are 'std::ostream {aka std::basic_ostream}' and 'int')
cout
Main.cc:14:9: note: no known conversion for argument 1 from 'std::ostream {aka std::basic_ostream}' to 'int'
In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
from /usr/include/c++/5/bits/char_traits.h:39,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/ostream:38,
from /usr/include/c++/5/iostream:39,
from Main.cc:2:
/usr/include/c++/5/bits/stl_pair.h:220:5: note: candidate: template constexpr bool std::operator<(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
^
/usr/include/c++/5/bits/stl_pair.h:220:5: note: template argument deduction/substitution failed:
Main.cc:14:13: note: 'std::ostream {aka std::basic_ostream}' is not derived from 'const std::pair<_T1, _T2>'
cout