Submission #1353704
Source Code Expand
#include <iostream> using namespace std; int main() { string a; cin >> a; if(a == 'a') cout << -1 << endl; else cout << 'a' << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 辞書式順序 |
User | kaoru6287 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 177 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:10: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘char’) if(a == 'a') cout << -1 << endl; ^ In file included from /usr/include/c++/5/iosfwd:40:0, from /usr/include/c++/5/ios:38, from /usr/include/c++/5/ostream:38, from /usr/include/c++/5/iostream:39, from ./Main.cpp:1: /usr/include/c++/5/bits/postypes.h:216:5: note: candidate: template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&) operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) ^ /usr/include/c++/5/bits/postypes.h:216:5: note: template argument deduction/substitution failed: ./Main.cpp:8:13: note: ‘std::string {aka std::basic_string<char>}’ is not derived from ‘const std::fpos<_StateT>’ if(a == 'a') cout << -1 << endl; ^ In file included from /usr/include/c++/5/bits/stl_algobase...