Submission #2853550


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
string a;
string b = "aiueo";
int c = 0;
int i;

int main(){
  cin>>a;
  for(i=0;i<5;++i){
    if(a == b[i]){
      cout<<"vowel"<<endl;
      c = 1;
      break;
    }
  }
  if(c == 0){
    cout<<"consonant"<<endl;
  }
}

Submission Info

Submission Time
Task A - UOIAUAI
User terasak
Language C++14 (GCC 5.4.1)
Score 0
Code Size 286 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:10: error: no match for ‘operator==’ (operand types are ‘std::string {aka std::basic_string<char>}’ and ‘char’)
     if(a == b[i]){
          ^
In file included from /usr/include/c++/5/unordered_set:48:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:116,
                 from ./Main.cpp:1:
/usr/include/c++/5/bits/unordered_set.h:1421:5: note: candidate: template<class _Value, class _Hash, class _Pred, class _Alloc> bool std::operator==(const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&, const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>&)
     operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
     ^
/usr/include/c++/5/bits/unordered_set.h:1421:5: note:   template argument deduction/substitution failed:
./Main.cpp:11:16: note:   ‘std::string {aka std::basic_string<char>}’ is not derived from ‘const std::unordered_multiset<_Value, _Hash, _Pred, _Alloc>’
     if(a == b[i]){
                ^
...