Submission #1675543


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
int main()
{
  string W;
  cin >> W;
  char vowel[5] = {'a',
                   'i',
                   'u',
                   'e',
                   'o'};
  int i = 0;
  while (i < W.length())
  {
    bool isVowel = false;
    for (int j = 0; j < vowel.size(); j++)
    {
      if (W[i] == vowel[j])
        isVowel = true;
    }
    if (isVowel)
    {
      W.erase(W.begin() + i);
    }
    else
    {
      ++i;
    }
  }

  cout << W << endl;

  return 0;
}

Submission Info

Submission Time
Task B - 罠
User aximov
Language C++14 (GCC 5.4.1)
Score 0
Code Size 543 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:16:31: error: request for member ‘size’ in ‘vowel’, which is of non-class type ‘char [5]’
     for (int j = 0; j < vowel.size(); j++)
                               ^