Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- int main()
- {
- /*char a[201], vocale[15]="AEIOUaeiou";
- int gasit1, gasit2, ct=0, i=0;
- cin.get(a, 201);
- while(a[i])
- {
- if(strchr(vocale,a[i]))
- gasit1=1;
- else
- gasit1=0;
- while(a[i]!=' ' && a[i]!=0)
- i++;
- if(strchr(vocale, a[i-1]))
- gasit2=1;
- else
- gasit2=0;
- if(gasit1*gasit2==1)
- ct++;
- i++;
- }
- if(ct==0)
- cout<<"Nu exista";
- else
- cout<<ct;*/
- char a[256], v[11]="aeiouAEIOU", *p;
- int ct=0, n;
- p=strtok(a, " ");
- while(p)
- {
- n=strlen(p);
- if(strchr(v,p[0]) && strchr(v, p[n-1]))
- ct++;
- p=strtok(NULL, " ");
- }
- cout<<ct;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement