Answer:
see explaination
Explanation:
#include<stdio.h>
#include <conio.h>
#include <ctype.h>
bool ishawaiian(char,int *);
int main()
{bool legal=true;
char ch;
intlast_ch=0,i;
char inword[20];
int kt=0,voc,done;
while((ch = getchar()) != EOF)
{inword[kt++]=ch;
if(ishawaiian(ch,&voc))
{if(voc==1)
if(kt!=1)
if(last_ch==1)
legal=false;
last_ch=voc;
}
else
{if(voc=3&&!(isspace(ch)||ispunct(ch)))
{legal=false;
done=0;
while(done==0)
{ch = getchar();
if(!(isspace(ch)||ispunct(ch)))
inword[kt++]=ch;
else
{done=1;
kt++;
}
}
}
kt--;
printf("\n");
for(i=0;i<kt;i++)
printf("%c",inword[i]);
if(legal)
printf(": it isvalid\n");
else
printf(": it isinvalid\n");
legal=true;
kt=0;
}
}
getch();
return 0;
}
bool ishawaiian(charch,int* voc)
{charletter[13]={'a','e','i','o','u','h','k','l','m','n','p','w','\''};
int i;
for(i=0;i<13;i++)
{if(ch==letter[i])
{if(i<5)
*voc=0;
else
*voc=1;
returntrue;
}
}
*voc=3;
return false;
}