Problem seats2
User Jinxuan
Submission Time 2024-11-08 08:46:08
Score 0
Max Time N/A
Max Memory N/A

Compile Error

seats2.cpp: In function ‘int main()’:
seats2.cpp:7:21: error: ‘n’ was not declared in this scope
7 | for (int x = 2; x <n; x++) {
| ^
seats2.cpp:10:7: error: no match for ‘operator<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘int’)
10 | cout < ans;
| ~~~~ ^ ~~~
| | |
| | int
| std::ostream {aka std::basic_ostream<char>}
seats2.cpp:10:7: note: candidate: ‘operator<(int, int)’ <built-in>
10 | cout < ans;
| ~~~~~^~~~~
seats2.cpp:10:7: note: no known conversion for argument 1 from ‘std::ostream’ {aka ‘std::basic_ostream<char>’} to ‘int’
In file included from /usr/include/c++/9/regex:62,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:110,
from seats2.cpp:1:
/usr/include/c++/9/bits/regex.h:1048:5: note: candidate: ‘template<class _BiIter> bool