这是我的代码,在编译时,当我调用isVowel()函数时,它在类型转换中显示错误.你可以检查并告诉错误是什么?
#include <iostream>
#include <string>
#include <typeinfo>
using namespace std;
bool isVowel(string a)
{
if(a == "a" || a =="e" || a =="i" || a =="o" ||a =="u"){
return true;
}
else
return false;
}
int main()
{
int T;
cin>>T;
for (int i = 0; i < T; i++)
{
string s, snew="";
cin>>s;
for (int j=0;j<s.length();j++)
{
if(isVowel(s[j]))
continue;
else
snew += s[j];
}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)