Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string slog(string a)
- {
- int b = 0;
- string k = "";
- for(int i=0; i<a.length(); i++)
- if(a[i]=='a'||a[i]=='A'||a[i]=='e'||a[i]=='E'||a[i]=='i'||a[i]=='I'||a[i]=='o'||a[i]=='O'||a[i]=='u'||a[i]=='U')
- k = k + a[i];
- else if (a[i]!=' ')
- {
- k = k + a[i];
- break;
- }
- else break;
- return k;
- }
- string pos_rijec(string a)
- {
- string k = "";
- for (int i=a.length()-1; i>=0; i--)
- if (a[i]!=' ')
- k = k + a[i];
- else break;
- return k;
- }
- main()
- {
- int n;
- string s[50], a, b, c, d;
- cin >> n;
- for (int i=0; i<=4*n; i++)
- getline(cin, s[i]);
- for (int i=0; i<n; i++)
- {
- a = slog(pos_rijec(s[i*4+1]));
- b = slog(pos_rijec(s[i*4+2]));
- c = slog(pos_rijec(s[i*4+3]));
- d = slog(pos_rijec(s[i*4+4]));
- // cout << a << " " << b << " " << c << " " << d << endl;
- if (a==b && b==c && c==d)
- cout << "savrsena" << endl;
- else if (a==b && c==d)
- cout << "parna" << endl;
- else if (a==c && b==d)
- cout << "ukrstena" << endl;
- else if (a==d && b==c)
- cout << "obgrljena" << endl;
- else cout << "slobodan stih" << endl;
- }
- system ("PAUSE");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement