2nd_Sem_Bogachev/2025.05.23/dist/Krivoruchenko_SK/solve_01.c
2025-05-20 20:40:38 +03:00

23 lines
345 B
C

#include "solve_01.h"
#include "node.h"
#include <string.h>
int t1_solve (node *head)
{
char *maximum = head->string;
int count = 1;
for (head = head->next; head; head = head->next)
{
int cmp = strcmp(head->string, maximum);
if (cmp > 0) {
maximum = head->string;
count = 1;
} else if (!cmp)
count++;
}
return count;
}