Submission #3979084
Source Code Expand
#include<iostream> using namespace std; int main(){ string s; cin>>s; cout<<(s=='a'?"-1":'a')<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 植木算 |
User | ate |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 129 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:11: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘char’) cout<<(s=='a'?"-1":'a')<<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:6:13: note: ‘std::string {aka std::basic_string<char>}’ is not derived from ‘const std::fpos<_StateT>’ cout<<(s=='a'?"-1":'a')<<endl; ^ In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0...