#include<fstream.h>
#include<string.h>
ofstream fout("t.in");
void main()
{ char s[255];
int i,k=0;
char v[]="AEIOUaeiou";
cin.get(s,255);
fout<<s<<endl;
fout.close();
ifstream fin("t.in");
while(fin>>s)
{ if(strchr(v,s[0]) && strchr(v,s[strlen(s)-1]))
k++;
}
cout<<k;
fin.close();
}
sau
#include<iostream.h>
#include<string.h>
void main()
{ char s[255];
int i,k=0;
char v[]="AEIOUaeiou";
cin.get(s,255);
for(i=0;i<strlen(s);i++)
if(strchr(v,s[i]) && (i==0 || s[i-1]==' '))
{ int j=i;
while(s[j]!=' ' && j<strlen(s)) j++;
if(strchr(v,s[j-1])) k++;
}
cout<<k;
}
|