Problem fizzbuzz
User xingrui
Submission Time 2024-06-26 16:25:59
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fizzbuzz.cpp: In function ‘int main()’:
fizzbuzz.cpp:17:19: error: invalid use of member function ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]’ (did you forget the ‘()’ ?)
17 | if(output.length == 0){
| ~~~~~~~^~~~~~
| ()
fizzbuzz.cpp:18:34: error: expected ‘;’ before ‘}’ token
18 | output = to_string(i)
| ^
| ;
19 | }
| ~
fizzbuzz.cpp:22:5: error: expected ‘}’ at end of input
22 | }
| ^
fizzbuzz.cpp:4:1: note: to match this ‘{’
4 | {