fork(1) download
  1. #include <iostream>
  2. #include <utility>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <cstring>
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10. char x[2], ss[201];
  11. //cin >> x;
  12. cin.getline(x, 2);
  13. while (cin.getline(ss, 201)) {
  14. char *p = strtok(ss, " /n ,.;:?! ... -" " `");
  15. while (p) {
  16. char sss[201] = "\0";
  17. strcpy(sss, p);
  18. //cout << sss << '\n';
  19.  
  20. int specialStar = 0, lg = strlen(sss);
  21. int otherStars = 0;
  22. for (int i = 0; i < lg; ++i) {
  23. if (strchr("eiou", sss[i])) {
  24. ++otherStars;
  25. }
  26. if (sss[i] == x[0]) {
  27. ++specialStar;
  28. }
  29. }
  30. if (specialStar == 1 && otherStars == 0) {
  31. /*for (int i = 0; i < lg; ++i) {
  32.   cout << sss[i];
  33.   }
  34.   cout << '\n';*/
  35. cout << p << '\n';
  36. }
  37. p = strtok(NULL, " /n ,.;:?! ... -" " `");
  38. }
  39. }
  40. //cout << ss;
  41. }
Success #stdin #stdout 0.01s 5444KB
stdin
a
nar, acesta este un an bisect
nu un an normal.
a aaa cad
stdout
ar
a
a
a
cad