Problem givingtree
User King6767
Submission Time 2026-06-23 10:37:56
Score 0
Max Time N/A
Max Memory N/A

Compile Error

givingtree.cpp:3:19: error: ‘maxWidth’ was not declared in this scope
3 | int spaces = (maxWidth - width) / 2;
| ^~~~~~~~
givingtree.cpp:3:30: error: ‘width’ was not declared in this scope; did you mean ‘wcwidth’?
3 | int spaces = (maxWidth - width) / 2;
| ^~~~~
| wcwidth
givingtree.cpp:4:4: error: expected unqualified-id before ‘<’ token
4 | <iostream> << std::string(spaces, ' ');
| ^
givingtree.cpp:6:5: error: expected unqualified-id before ‘if’
6 | if (isHollow && rowIdx > 0 && rowIdx < height - 1) {
| ^~
givingtree.cpp:12:7: error: expected unqualified-id before ‘else’
12 | } else {
| ^~~~
givingtree.cpp:15:1: error: expected declaration before ‘}’ token
15 | }
| ^
givingtree.cpp: In function ‘int main()’:
givingtree.cpp:18:20: error