-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path111.c
45 lines (39 loc) · 814 Bytes
/
111.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
40
41
42
43
44
45
#include <stdio.h>
#include <string.h>
int main()
{
int i, j, k, l, len, count = 0;
char s[] = "this is level 16";
// gets(s);
len = strlen(s);
for (i = 0; i < len; i++)
{
if (s[i] != ' ' || s[i] != '\n')
{
for (j = i; j < len; j++)
{
if (s[j] == ' ' || s[j] == '\n')
break;
}
}
for (k = i, l = j - 1;;)
{
if (s[k] != s[l])
break;
else if (k >= l)
{
count = count + 1;
break;
}
else
{
k = k + 1;
l = l - 1;
continue;
}
}
i = j;
}
printf("\n%d", count);
return 0;
}