-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathcomplete_sequence.cpp
39 lines (30 loc) · 908 Bytes
/
complete_sequence.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// https://www.urionlinejudge.com.br/judge/en/problems/view/1551
#include <iostream>
#include <string>
using namespace std;
bool find_letter(char c) {
string alphabet = "abcdefghijklmnopqrstuvwxyz";
if (alphabet.find(c) != -1) return true;
return false;
}
bool not_in_phrase(char c, string phrase) {
if (phrase.find(c) == -1) return true;
return false;
}
int main() {
int n;
cin >> n;
cin.ignore();
string phrase;
while (n--) {
getline(cin, phrase);
string letters_on_phrase = "";
for (int i = 0; i < phrase.size(); i++) {
if (find_letter(phrase[i]) && not_in_phrase(phrase[i], letters_on_phrase)) letters_on_phrase += phrase[i];
}
if (letters_on_phrase.size() == 26) cout << "frase completa" << endl;
else if (letters_on_phrase.size() >= 13) cout << "frase quase completa" << endl;
else cout << "frase mal elaborada" << endl;
}
return 0;
}