Task 7 is done
This commit is contained in:
parent
6f21fa116f
commit
6ef0a8bfb3
17 changed files with 138 additions and 44 deletions
|
@ -6,15 +6,21 @@
|
|||
int t6_solve (node *head)
|
||||
{
|
||||
char *last = head->string;
|
||||
int count = 1;
|
||||
int count = 0, local = 0;
|
||||
|
||||
for (head = head->next; head; head = head->next)
|
||||
{
|
||||
if (strcmp(head->string, last))
|
||||
count++;
|
||||
if (strcmp(head->string, last) == 0)
|
||||
local = 1;
|
||||
else {
|
||||
count += local;
|
||||
local = 0;
|
||||
}
|
||||
last = head->string;
|
||||
}
|
||||
|
||||
count += local;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue