Task: | Sanat |
Sender: | |
Submission time: | 2015-12-21 10:30:06 +0200 |
Language: | C++ |
Status: | READY |
Result: | 64 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 64 |
test | verdict | time | score | |
---|---|---|---|---|
#1 | ACCEPTED | 0.18 s | 64 | details |
Compiler report
input/code.cpp: In function 'bool ien(std::string)': input/code.cpp:19:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0; i<s.size(); ++i)++z[s[i]]; ^ input/code.cpp:19:41: warning: array subscript has type 'char' [-Wchar-subscripts] for (int i=0; i<s.size(); ++i)++z[s[i]]; ^ input/code.cpp:21:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=1; i<s.size(); ++i) if (i && s[i]==s[i-1]) return 0; ^
Code
#include <iostream> #include <vector> using namespace std; int n; int z[255]; bool vw(char c){ return c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='y'; } bool ien(string s){ if (!vw(s[0]) && !vw(s[1])) return 1; if (!vw(s[s.size()-1])) return 1; for (int i='a'; i<='z'; ++i) z[i]=0; for (int i=0; i<s.size(); ++i)++z[s[i]]; if (z['c'] || z['q'] || z['w'] || z['x'] || z['z']) return 1; for (int i=1; i<s.size(); ++i) if (i && s[i]==s[i-1]) return 0; if (z['b'] || z['d'] || z['f'] || z['g']) return 1; if (z['y'] && (z['a'] || z['o'] || z['u'])) return 1; char kv=s[s.size()-3]; if (s[s.size()-1]=='e' && (kv=='u' || kv=='i')) return 1; return 0; } int main(){ cin >> n; for (int i=0; i<n; ++i){ string s; cin >> s; if (ien(s)) cout << "QAQ\n"; else cout << "10-4\n"; } }