fork download
  1. #include <iostream>
  2. #include <cstring>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. char x, text[2005], cuv[2005], vowels[2005] = {'a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U'};
  7. int n, maxp = -1;
  8.  
  9. int main() {
  10. cin >> x;
  11. ifstream fin("sub.in");
  12. while (cin.getline(text, 1001)) {
  13. char *p = strtok(text, " ,.?!");
  14. while (p != NULL) {
  15. strcpy(cuv, p);
  16. int lg = strlen(cuv), cnt = 0, vocale = 0;
  17. for (int i = 0; i < lg; ++i) {
  18. if (strchr(vowels, cuv[i])) {
  19. ++vocale;
  20. }
  21. if (cuv[i] == x) {
  22. ++cnt;
  23. }
  24. }
  25. if (cnt == 1 && vocale == 1) {
  26. cout << cuv << '\n';
  27. }
  28. p = strtok(NULL, " ?!,.");
  29. }
  30. }
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0.01s 5444KB
stdin
a
nae
stdout
Standard output is empty