My issue
My code
// Update the code below to solve the problem
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t,l=0;
cin >> t;
while(t--)
{
string S;
cin >> S;
int b=S.length();
for(int i=0;i<(b-2);i++)
{
if (S[i]=='a' || S[i]=='e' || S[i]=='i' || S[i]=='o' || S[i]=='u')
{
if(S[i+1]=='a' || S[i+1]=='e' || S[i+1]=='i' || S[i+1]=='o'|| S[i+1]=='u')
{
if(S[i+2]=='a' || S[i+2]=='e' || S[i+2]=='i' || S[i+2]=='o'|| S[i+2]=='u')
{
t=1;
break;
}
}
}
}
if(t==1)
{
cout<<"happy"<<endl;
}
else
{
cout<<"sad"<<endl;
}
}
}
Learning course: C++ for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone