// Ex10_1.cpp
#include <stdio.h>
#include <string.h>
struct zap  {
            char det[10];
            float diam;
            zap *p;
            };
int main()
{	  zap a,*r,*q,*f;
      r=new zap;
      r->p=NULL;
      puts("Input nane and diametr");
      scanf("%s %f\n",r->det,&r->diam);
      while((scanf("\n%s",a.det)),strcmp(a.det,"end")!=0)
     { scanf("%f",&a.diam);
       q=r;
       r=new zap;
       strcpy(r->det,a.det);
       r->diam=a.diam;
       r->p=q;
     }
    puts("-------Spisok of detals--------");
    puts("   Name    Diametr ");
    q=r;
    while(q!=NULL)
     { printf("%12s %8.5f\n",q->det,q->diam);
       q=q->p;
     }
      q=r;
      do {
      if(q->diam<1)
        { if(q==r) { r=r->p;
             delete q;
             q=r;}
          else { q=q->p;
                     delete f->p;
             f->p=q;}
        }
      else { f=q;
         q=q->p;}
     }
      while(q!=NULL);
      q=r;
      puts("------Result--------");
      if(q==NULL) puts("No information");
      else do {
           printf("%12s %8.5f\n",q->det,q->diam);
           q=q->p;
          }
       while (q!=NULL);
       return 0;
}
