# A. experiment 11  4  preliminary list

Title Description

Problem Description: you know a sequence of positive integers, the number of which is unknown, but there is at least one element. Your task is to establish a single chain table, and use the chain table to store the sequence of positive integers, then count the maximum and minimum values of the elements in the sequence, and calculate the sum of all the elements in the sequence. The input of positive integer uses - 1 as the end flag. Note that - 1 does not count the elements in the positive integer sequence (do not count - 1).
Input and output requirements: input a positive integer sequence. The number of positive integer sequence elements is unknown, but it ends with "- 1". Input at least one positive integer before "- 1". Elements in the sequence range from 1 to 9999999. Output three positive integers, that is, the maximum value, the minimum value, and the sum of all elements.
The maximum number of test case nodes is 1000. All integers can be stored in int type.
Note the input and output formats.

sample input

`1 4 99 21 50 61 32 4 -1`

sample output

`The maximum,minmum and the total are:99 1 272`
```#include<stdio.h>
#include<stdlib.h>
{
int data;
struct node *next;
};
typedef struct node NODE;//rename
NODE * createNode();//Create linked list function
int findMax(NODE * head);//Maximum function, return integer
int findMin(NODE * head);//Minimum function, return integer
int sum = 0;//and
int main()
{

return 0;
}
NODE * createNode()
{
int num;
NODE * current = NULL;
NODE * last = NULL;
scanf("%d", &num);
while (num != -1)
{
current = malloc(sizeof(NODE));
if (current != NULL)
{
current->data = num;
sum += num;
{
last = current;
}
else
{
last->next = current;
last = current;
}
}
scanf("%d", &num);
}
last->next = NULL;
}

{
NODE * temp;
{
free(temp);
}
}

{
int max=sptr->data;
while (sptr!=NULL)
{
if (sptr->data > max)
max = sptr->data;
sptr = sptr->next;
}
return max;
}

{