Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- #define NMAX 103
- #define VOWELS "aeiou"
- char s[NMAX];
- int main() {
- cin.getline(s, NMAX);
- char *word = strtok(s, " ");
- int ans = 0;
- while (word) {
- int nrv = 0, nrc = 0;
- for (int i = 0; word[i]; i++) {
- if (strchr(VOWELS, word[i])) {
- nrv++;
- } else {
- nrc++;
- }
- }
- ans += nrc == nrv;
- word = strtok(NULL, " ");
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement