#include <iostream>#include <string>using namespace std;bool sol(string check);int main(){int num;int cnt = 0;cin >> num;for (int i = 0; i < num; i++){string str;cin >> str;if (sol(str)){cnt++;}}cout << cnt << endl;return 0;}bool sol(string check){bool alp[26] = { false, };for (int i = 0; i < check.length(); i++){if (alp[check[i] - 'a'])return false;else{alp[check[i] - 'a'] = true;char temp = check[i];while (1){if (temp != check[++i]){i--;break;}}}}return true;}
'백준' 카테고리의 다른 글
| [5622] 다이얼 (0) | 2018.07.14 |
|---|---|
| [2908] 상수 (0) | 2018.07.14 |
| [1157] 단어 공부 (0) | 2018.07.14 |
| [10809] 알파벳 찾기 (0) | 2018.07.14 |
| [11654] 아스키 코드 (0) | 2018.07.14 |