好乱,给个完整版

冰雪再寒冷严冬再漫长,也无法阻挡春的回归。可我们都忘却了,春天再逼近,也无法阻挡下一个冬天的来临……
能不能帮我修改一下!
#include "stdio.h"
#include "iostream.h"
#include "malloc.h"
struct LINKLIST
{
   int data;
   struct LINKLIST *head,*last;
}
/******************************/
/*         按序号查找         */
/******************************/
LINKLIST *get(int i,LINKLIST *head)
{
   int j;
   p=head;
   while((j<i)&&(p->next!=NULL))
     {
        p=p-next;
        j++;
     }
   if(j==i)
     return p;
   else
     return NULL;       
}
/******************************/
/*          按值查找          */
/******************************/
LINKLIST *locate(DATATYPE2 X,LINKLIST *head)
{
   LINKLIST *p;
   p=head->next;
   while(p!=NULL)
     if(p->data==x)
 return p;
     else
 p=p->next;
   return NULL; 
}
/******************************/
/* 在以知结点的后面插入新结点 */
/******************************/
void insertafter(DATATYPE2 x,LINKLIST *p)
{
   LINKLIST *t;
   t=malloc(sizeof(LINKLIST))
   t->data=p->next;
   p->next=t;
}
/******************************/
/* 在以知结点的前面插入新结点 */
/******************************/
int insertbefor(DATATYPE2 x,int i,LINKLIST *head)
{
   LINKLIST *p;
   int r=1;
   p=get(i-1,head);
   if(p!=NULL)
     insertbefor(x,p)
   else
     r=0;
   return r;
}
/******************************/
/*        删除第i个结点       */
/******************************/
int deleteordor(int i,LINKLIST *head)
{
   LINKLIST *p;
   int r=1;
   p=get(i-1,head);
   if((p!=NULL)&&(p->next!=NULL))
     deletefter(p);
   else
     r=0;
   return r;
}
void main()
{
   LINKLIST *head,*last,*t;
   char ch;
   t=(struct LINKLIST*)malloc(sizeof(struct LINKLIST))    //建立表头结点
   head=t;
   last=t;
   t->next=NULL;
   while(ch=getchar()!='$')
     {
 t=(struct LINKLIST*)malloc(sizeof(struct LINKLIST));
 t->data=ch;
 last->next=t;
 last=t;
 t->next=head;
     }
}

要求:建立一个带有头结点的单向循环链表
用户输入命令有:
 
1:输出单向循环链表的所有结点的值
2:查找第i个结点或值为某一个值的结点
3:在指定的地方插入一个结点
4:删除指定的结点
我有个还没完成的程序 请指教 能帮忙完成主函数的调用最好 希望有个菜单!
#include "stdio.h"
#include "iostream.h"
#include "malloc.h"
struct LINKLIST
{
   int data;
   struct LINKLIST *head,*last,*next;
};
/******************************/
/*         按序号查找         */
/******************************/
struct LINKLIST *get(int i,struct LINKLIST *head)
{
   int j;
   p=head;
   while((j<i)&&(p->next!=NULL))
     {
        p=p-next;
        j++;
     }
   if(j==i)
     return p;
   else
     return NULL;       
}
/******************************/
/*          按值查找          */
/******************************/
struct LINKLIST *locate(int x,struct LINKLIST *head)
{
   struct LINKLIST *p;
   p=head->next;
   while(p!=NULL)
     if(p->data==x)
 return p;
     else
 p=p->next;
   return NULL; 
}
/******************************/
/* 在以知结点的后面插入新结点 */
/******************************/
void insertafter(DATATYPE2 x,LINKLIST *p)
{
   struct LINKLIST *t;
   t=(struct LINKLIST*)malloc(sizeof(struct LINKLIST))
   t=p->next;
   p->next=t;
}
/******************************/
/* 在以知结点的前面插入新结点 */
/******************************/
int insertbefor(int x,int i,struct LINKLIST *head)
{
   struct LINKLIST *p;
   int r=1;
   p=get(i-1,head);
   if(p!=NULL)
     insertbefor(x,i,p)
   else
     r=0;
   return r;
}
/******************************/
/*        删除第i个结点       */
/******************************/
int deleteordor(int i,struct LINKLIST *head)
{
   struct LINKLIST *p;
   int r=1;
   p=get(i-1,head);
   if((p!=NULL)&&(p->next!=NULL))
     deleteordor(i,p);
   else
     r=0;
   return r;
}
void main()
{
   struct LINKLIST *head,*last,*t;
   char ch;
   int i.k;
   t=(struct LINKLIST*)malloc(sizeof(struct LINKLIST))    //建立表头结点
   head=t;
   last=t;
   t->next=NULL;
   count<<"请输入结点,以0结束"
   while(ch=getchar()!='0')
     {
  t=(struct LINKLIST*)malloc(sizeof(struct LINKLIST));
  t->data=ch;
  last->next=t;
  last=t;
  t->next=head;
     }
   }

