#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>

struct elem{
	int num;
	elem *next;
	};
	elem *first, *cur, *tmp, *last;
	char snum[10];

 void main()
 {
	 int n,k;
	 puts("Input integer value or ENTER");
  
   gets(snum);
   first=new elem;
  first->num=atoi(snum);
  first->next=NULL;
   last=first;
   while(gets(snum),strlen(snum)!=0)
   {cur=new elem;
    cur->num=atoi(snum);
	cur->next=NULL;
	last->next=cur;
	last=cur;
   }
  puts("inputed spisok first -> last");
  cur=first;
  while(cur!=NULL)
  {printf("%5d",cur->num);
  cur=cur->next;
  }
  printf("\n");
  int max=-3200,imax, min=3200, imin;
  float srs=0;
  cur=first;k=0;
  while(cur!=NULL)
   {k++;
    srs+=cur->num;
    if(cur->num>max)
    { 
	   max=cur->num;
	   imax=k;
    }
    if(cur->num<min)
    {
	   min=cur->num;
	   imin=k;
    }
    cur=cur->next;
   }
printf("Max=%5d  imax=%3d\n",max,imax);
printf("Min=%5d  imin=%3d\n",min,imin);
printf("srs=%5.2f  k=%3d\n",srs,k);

 }