水题 Codeforces Beta Round #70 (Div. 2) A. Haiku

 

题目传送门

 1 /*  2  水题:三个字符串判断每个是否有相应的元音字母,YES/NO  3  下午网速巨慢:(  4 */  5 #include <cstdio>  6 #include <cstring>  7 #include <string>  8 #include <iostream>  9 #include <algorithm> 10 #include <cmath> 11 using namespace std; 12 13 const int MAXN = 1e2 + 10; 14 const int INF = 0x3f3f3f3f; 15 string s[3]; 16 17 int main(void) //Codeforces Beta Round #70 (Div. 2) A. Haiku 18 { 19 // freopen ("A.in", "r", stdin); 20 21 while (getline (cin, s[0])) 22  { 23 getline (cin, s[1]); getline (cin, s[2]); 24 // cout << s[0] << endl << s[1] << endl << s[2] << endl; continue; 25 26 bool flag = true; 27 for (int i=0; i<3; ++i) 28  { 29 int cnt; int m = 0; 30 if (i == 0 || i == 2) cnt = 5; 31 else cnt = 7; 32 for (int j=0; s[i][j]; ++j) 33  { 34 if (s[i][j] == 'a' || s[i][j] == 'e' || s[i][j] == 'i' || s[i][j] == 'o' 35 || s[i][j] == 'u') m++; 36  } 37 if (m != cnt) flag = false; 38 if (!flag) break; 39  } 40 41 if (flag) puts ("YES"); 42 else puts ("NO"); 43  } 44 45 return 0; 46 }

 

你可能感兴趣的:(codeforces)