Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const string S[]={"lamoremio",
- "aabbii",
- "sichiama",
- "ddeeoo",
- "rosaria"};
- const unsigned int RIG=5;
- bool piuvocali(const string S[],const unsigned int RIG);
- int main()
- {
- cout <<"Se ci sono piu' vocali il risultato e' true, e il risultato e':"<<piuvocali(S,RIG);
- return 0;
- }
- bool piuvocali(const string S[],const unsigned int RIG)
- {
- unsigned int i=1,k,vocali=0,lun_x;
- string x;
- while (i<RIG)
- {
- k=1;
- while (k<S[i].length())
- {
- x+=S[i][k];
- k+=2;
- }
- i+=2;
- }
- lun_x=x.length();
- i=0;
- while (i<lun_x)
- {
- switch(x[i])
- {
- case('a'): case('e'): case('i'): case('o'): case('u'): vocali++;
- }
- i++;
- }// cout<<"\n"<<x<<"\n"; // da scommentare per debug
- if ((lun_x-vocali)<vocali) return true;
- else return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement