Создание базы данных по составлению синонимического словаря, страница 3

                  printf("\n/*4-удаление всех слов/синонимов         /*");

                  printf("\n/*0-выход                                /*");

                  printf("\n/*/*/*//*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*");

                  printf("\nВведите команду:");

                  scanf("%d",&r);

      switch(r)

      {

            case 1:

            {

                        printf("\n Данные о слове:");

                        Slovo *c=new Slovo;

                        char tmp[255];

                        printf("\nВведите слово: ");

                        scanf("%s",tmp);

                        c->SetWord(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите первый перевод: ");

                        scanf("%s",tmp);

                        c->SetTrans1(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите второй перевод: ");

                        scanf("%s",tmp);

                        c->SetTrans2(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите часть речи: ");

                        scanf("%s",tmp);

                        c->SetPart(tmp);

                        memset(tmp,0,255);

                              if (!pSlovos)

                                    pSlovos = c;

                              else

                                    pSlovos->AddTail(c);

                        break;

             }

            case 2:

            {

                        char name[30];

                        char w[21];

                        Slovo *c= (Slovo*) pSlovos->GetHead();

                        printf("\nПоиск слова по названию:");

                        scanf("%s",&name);

                        while(c && strcmp(name,c->GetTrans1())!=0)

                              c=(Slovo*)c->GetNext();

                        if(c==NULL)

                        {

                              printf("\nСовпадений не найдено");

                        break;

            }

                        printf("\n Данные о синониме:");

                        Sin *m=new Sin;

                        char tmp[255];

                        printf("\nВведите слово: ");

                        scanf("%s",tmp);

                        m->SetSword(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите первый перевод: ");

                        scanf("%s",tmp);

                        m->SetTrans1(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите второй перевод: ");

                        scanf("%s",tmp);

                        m->SetTrans2(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите часть речи: ");

                        scanf("%s",tmp);

                        m->SetPart(tmp);

                        memset(tmp,0,255);

                        printf("\nВведите иные сведения: ");

                        scanf("%s",tmp);

                        m->Setother(tmp);

                        memset(tmp,0,255);

                              if (!pSins)

                                    pSins = m;

                              else

                                    pSins->AddTail(m);

                        //Создаем первый элемент

                        Link *pTmp= new Link;

                        //Создаем связь перевод

                        pTmp->SetSlovo(c);

                        pTmp->SetSin(m);

                        printf("\nДата перевода:");

                        scanf("%s",w);

                        pTmp->SetHours(w);

                        //Помещаем в список элемент

                        if (pLink==NULL)

                              pLink=pTmp;

                        else

                              pLink->AddTail(pTmp);

                        break;

            }

            case 3:

            {

                        int k=0;

                        printf("\nЧто удалить:слово(нажми 1) или синоним(нажми 2) ");

                        scanf("%d",&k);

                        switch(k)

                        {

                              case 1:

                              {

                                    int n=0;

                                    printf("Какой по счету элемент удалить? ");

                                    scanf("%d", &n);

                                    Slovo *pCur = (Slovo*)  pSlovos->GetHead();

                                    for (int i = 0; i < n-1; i++)

                                    {

                                         if (pCur)

                                               pCur = (Slovo*) pCur->GetNext();

                                    }

                                    pCur->RemoveItem();

                                    printf("\n!Данный элемент удален");

                                    break;

                              }

                              case 2:

                              {

                                    int n=0;