// Ocherrand.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

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

 void main()
 {
	 int n,k,a,b;
	 srand((unsigned)time(NULL));
	 
  n=rand()%21+10;
  puts("Input interval for integer vflue");
  puts("Min :");
  scanf("%d",&a);
  puts("Max :");
  scanf("%d",&b);
	  k=rand()%(b-a+1)+a;
   first=new elem;
  first->num=k;
  first->next=NULL;
   last=first;
   for(int i=1;i<n;i++)
   {cur=new elem;
    cur->num=rand()%(b-a+1)+a;
	cur->next=NULL;
	last->next=cur;
	last=cur;
   }
  puts("inputed spisok first -> last");
  cur=first;k=0;
  while(cur!=NULL)
  {printf("%5d",cur->num);
   k++;
   cur=cur->next;
  }
  printf("\n");
  printf("Number elements of spisor=%5d\n",k);
 }