실행 실패 (제출 코드 컴파일 에러)
Main.cpp: In function ‘int main()’: Main.cpp:8:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 8 | if (str[0] = ' ') int sum = 0; Main.cpp:8:31: warning: unused variable ‘sum’ [-Wunused-variable] 8 | if (str[0] = ' ') int sum = 0; | ^~~ Main.cpp:9:18: warning: unused variable ‘sum’ [-Wunused-variable] 9 | else int sum = 1; | ^~~ Main.cpp:10:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 10 | for (int i = 0; i < str.length(); i++) { | ~~^~~~~~~~~~~~~~ Main.cpp:11:36: error: ‘sum’ was not declared in this scope 11 | if (str[i] == ' ') sum++; | ^~~ Main.cpp:14:17: error: ‘sum’ was not declared in this scope 14 | cout << sum; | ^~~
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
반례를 발견하지 못했습니다.