0_0_39031203_16874.cpp:3:15: error: 'string' was not declared in this scope
3 | int countOnes(string s) { int count = 0; for (char c : s) { if (c == '1') { count++; } } return count; }
| ^~~~~~
0_0_39031203_16874.cpp:3:15: note: suggested alternatives:
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iosfwd:41,
from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:40,
from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:40,
from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:41,
from 0_0_39031203_16874.cpp:1:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/locale_classes.h:40,
from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/ios_base.h:41,
from gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ios:44:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:66:11: note: 'std::pmr::string'
66 | using string = basic_string<char>;
| ^~~~~~
0_0_39031203_16874.cpp: In function 'int main()':
0_0_39031203_16874.cpp:7:14: error: 'string' was not declared in this scope
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~~~~~
0_0_39031203_16874.cpp:7:14: note: suggested alternatives:
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/string:66:11: note: 'std::pmr::string'
66 | using string = basic_string<char>;
| ^~~~~~
0_0_39031203_16874.cpp:7:43: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~~
| std::cin
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
0_0_39031203_16874.cpp:7:50: error: 'input' was not declared in this scope; did you mean 'int'?
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~~~~
| int
0_0_39031203_16874.cpp:7:92: error: expected ';' before 's'
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~
| ;
0_0_39031203_16874.cpp:7:103: error: 's' was not declared in this scope
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^
0_0_39031203_16874.cpp:7:127: error: 'countOnes' cannot be used as a function
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ~~~~~~~~~^~~
0_0_39031203_16874.cpp:7:255: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~~~
| std::cout
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
0_0_39031203_16874.cpp:7:268: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
7 | int main() { string input; while (true) { cin >> input; if (input == "#") { break; } string s; cin >> s; int count = countOnes(s); char parity = input[input.size() - 1]; char correctParity = getParityChar(count, parity); s[s.size() - 1] = correctParity; cout << s << endl; } return 0; }
| ^~~~
| std::endl
gcc-13.1.0/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/ostream:735:5: note: 'std::endl' declared here
735 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|