- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- string input;
- while(getline(cin, input)){
- if(input == "e/o/i")break;
- int sz = input.size(), flag = 1, cnt = 0, f = 0;
- for(int i = 0; i < sz; i++){
- if(input[i] == 'a' || input[i] == 'e' || input[i] == 'i' || input[i] == 'o' || input[i] == 'u' || input[i] == 'y'){
- if(!f)cnt += 1, f = 1;
- }
- else f = 0;
- if(input[i] == 47 || i == sz-1){
- if(flag == 1 && cnt == 5)flag += 1, cnt = 0;
- else if(flag == 2 && cnt == 7)flag += 1, cnt = 0;
- else if(flag == 3 && cnt == 5)flag += 1, cnt = 0;
- else break;
- }
- }
- if(flag == 4)cout << "Y" << endl;
- else cout << flag << endl;
- }
- return 0;
- }
Friday, April 24, 2015
UVa - 576 - Haiku Review
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment