Problem platonic11
User KingH
Submission Time 2026-02-09 16:39:50
Score 0
Max Time N/A
Max Memory N/A

Compile Error

platonic11.cpp: In function ‘int main()’:
platonic11.cpp:8:7: error: ‘i’ was not declared in this scope
8 | for (i = 1; i < n; i ++){
| ^
platonic11.cpp:11:27: error: invalid use of member function ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]’ (did you forget the ‘()’ ?)
11 | for (int j = 0; j < pres.size; j++){
| ~~~~~^~~~
| ()
platonic11.cpp:12:10: error: ‘v’ was not declared in this scope
12 | sum += v[i]
| ^
platonic11.cpp:12:12: error: ‘i’ was not declared in this scope
12 | sum += v[i]
| ^
platonic11.cpp:15:13: error: expected ‘;’ before ‘}’ token
15 | cout << sum
| ^
| ;
16 | }
| ~