AtCoder Beginner Contest 007

Submission #3979084

Source codeソースコード

#include<iostream>
using namespace std;
int main(){
  string s;
  cin>>s;
  cout<<(s=='a'?"-1":'a')<<endl;
  return 0;
}

Submission

Task問題 A - 植木算
User nameユーザ名 ate
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 129 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./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...

Test case