Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #define VOWELS "aeiouAEIOU"
- using namespace std;
- bool isOk(char *s) {
- int nrv = 0;
- for (int i = 0; VOWELS[i]; i++) {
- if (strchr(s, VOWELS[i])) {
- nrv++;
- }
- }
- return nrv == 1;
- }
- int main() {
- char s[102];
- gets(s);
- char *p = strtok(s, " ");
- while (p) {
- if (isOk(p)) {
- puts(p);
- }
- p = strtok(NULL, " ");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement