Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool slog(char a, char b)
- {
- bool c, d;
- if (a=='a' || a=='A' || a=='e' || a=='E' || a=='i' || a=='I' || a=='o' || a=='O' || a=='u' || a=='U')
- c = true;
- else
- c = false;
- if (b=='a' || b=='A' || b=='e' || b=='E' || b=='i' || b=='I' || b=='o' || b=='O' || b=='u' || b=='U')
- d = true;
- else
- d = false;
- if ((c==true && d==false)||(c==false && d==true))
- return true;
- else return false;
- }
- void provjeri(string k)
- {
- bool p = true, c = true;
- if (k=="a" || k=="i" || k=="o" || k=="u")
- p = true;
- else if (k=="e")
- cout << k << endl;
- else
- {
- if (k.length()%2==0)
- {
- if (k[0]=='a' || k[0]=='A' || k[0]=='e' || k[0]=='E' || k[0]=='i' || k[0]=='I' || k[0]=='o' || k[0]=='O' || k[0]=='u' || k[0]=='U')
- p = false;
- else
- for(int i=0; i<k.length(); i=i+2)
- {
- if (slog(k[i], k[i+1])==false)
- {
- p = false;
- break;
- }
- }
- }
- else
- {
- if (k[0]=='a' || k[0]=='A' || k[0]=='e' || k[0]=='E' || k[0]=='i' || k[0]=='I' || k[0]=='o' || k[0]=='O' || k[0]=='u' || k[0]=='U')
- c = false;
- if(c==true)
- p = false;
- for(int i=1; i<k.length(); i=i+2)
- {
- if (slog(k[i], k[i+1])==false)
- {
- p = false;
- break;
- }
- }
- }
- }
- if (p==false)
- cout << k << endl;
- }
- main()
- {
- string s, k="";
- getline(cin, s);
- s = s + " ";
- for (int i=0; i<s.length(); i++)
- if ((s[i]<=122 && s[i]>=97)||(s[i]<=90 && s[i]>=65))
- k = k + s[i];
- else
- {
- if (k!="")
- provjeri(k);
- k="";
- }
- system("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement