Task 1 is done
This commit is contained in:
parent
f7e5c0b877
commit
23eff9e484
19 changed files with 553 additions and 10 deletions
23
2025.05.23/Example/solve.c
Normal file
23
2025.05.23/Example/solve.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "solve.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;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue