-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1316.c
39 lines (34 loc) · 765 Bytes
/
1316.c
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
//
//
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define N 100
int main(void)
{
int n;
int count = 0;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
char buffer[N];
scanf("%s", buffer);
bool checker['z' - 'a' + 1] = {false};
for (int j = 0; j < N; ++j) {
if (!buffer[j]) {
count++;
break;
}
else {
if (checker[buffer[j] - 'a'] && buffer[j - 1] != buffer[j]) {
break;
}
else {
checker[buffer[j] - 'a'] = true;
}
}
}
memset(buffer, 0, 100);
}
printf("%d\n", count);
return 0;
}