Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- int nr = 0;
- //char text[101] = "ei au plantat tamarix ea a adus iasomie";
- char text[101];
- cin.getline(text, 101);
- char *cuv = strtok(text, " ");
- while(cuv != NULL)
- {
- int voc = 0, cons = 0;
- for(int i = 0; i < strlen(cuv); i++)
- if(cuv[i] == 'a' || cuv[i] == 'e' || cuv[i] == 'i' || cuv[i] == 'o' || cuv[i] == 'u')
- voc++;
- /*
- for(int i = 0; i < strlen(cuv); i++)
- if(strchr("aeiou", cuv[i]))
- voc++;
- */
- cons = strlen(cuv) - voc;
- if(voc < cons)
- {
- cout << cuv << "\n";
- nr++;
- }
- cuv = strtok(NULL, " ");
- }
- if(nr == 0)
- cout << "Nu exista!";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement