C language question linked list vote

[problem description] A linked list is used to count the votes of candidates. The input parameter of the function Statistic: head points to the head of the chain, and name stores the name of the candidate. The function of this function is: if name, is found on the node of the linked list, the number of votes obtained on the node named name will be increased by 1; otherwise, create a new node, initialize its name and the number of votes, and insert the new node into the end of the chain. Finally, the first pointer to the linked list is returned.

[input form] enter the name of the candidate in turn, separated by a space. Enter 0 to end the entry.
[output form] name: number of votes
[sample input] q w e r q e e 0

[sample output]

QRV 2
WRV 1
ERV 3
RRV 1

my code

< H1 > include < iostream > < / H1 > < H1 > include < string.h > < / H1 > < H1 > include < stdlib.h > < / H1 >

struct Node
{

char name[12];
int count;
Node *next;

};
Node Statistic (Node head, char * name)
{

Node *p1 = head;
Node *p2=head;

if (head == 0)
{
    head = new Node;
    strcpy(head->name, name);
    head->count = 1;
    head->next = 0;
}
else
{
    while (p1)
    {
        if (strcmp(p1->name, name) == 0)
        {
            p1->countPP;
            break;
        }
        else
        {
            p2 = p1;
            p1 = p1->next;
        }
    }
    if (p1 = NULL)
    {
        p1 = new Node;
        strcpy(p1->name, name);
        p1->count = 1;
        p1->next = 0;
        p2->next = p1;
    }
}
return head;

}
void List (Node * head)
{

while (head)
{
    printf("%s:%d\n", head->name, head->count);
    head = head->next;
}

}
void Free (Node * head)
{

Node *p;
while (head) {
    p = head;
    head = head->next;
    delete p;
}

}
void main ()
{

Node *head = 0;
char name[12];
scanf("%s", &name);
while (strcmp(name, "0") != 0)
{
    head = Statistic(head, name);
    scanf("%s", &name);
}
List(head);
Free(head);
system("pause");

}
Why is it that my code can only enter the number of votes of the first person? what"s wrong with it? Please take a look at it for me. Thank you!

C
Mar.01,2021

-sharpinclude<iostream>
-sharpinclude<string.h>
-sharpinclude<stdlib.h>
struct Node
{

char name[12];
int count;
Node *next;
};
Node *Statistic(Node *head, char *name)  // 
{

Node *p1 = head;
Node *p2=head;

if (head == 0)
{
    head = new Node;
    strcpy(head->name, name);
    head->count = 1;
    head->next = 0;
}
else
{
    while (p1)
    {
        if (strcmp(p1->name, name) == 0)
        {
            p1->countPP;
            break;
        }
        else
        {
            p2 = p1;
            p1 = p1->next;
        }
    }
    if (p1 == NULL)    // 
    {
        p1 = new Node;
        strcpy(p1->name, name);
        p1->count = 1;
        p1->next = 0;
        p2->next = p1;
    }
}
return head;
}
void List(Node *head)
{

while (head)
{
    printf("%s:%d\n", head->name, head->count);
    head = head->next;
}
}
void Free(Node *head)
{

Node *p;
while (head) {
    p = head;
    head = head->next;
    delete p;
}
}
int  main()
{

Node *head = 0;
char name[12];
scanf("%s", name);        // &
while (strcmp(name, "0") != 0)
{
    head = Statistic(head, name);
    scanf("%s", name);
}
List(head);
Free(head);
system("pause");
return 0;
}
Menu