Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <stdlib.h>
- #include <cstring>
- #include <conio.h>
- #include <stdlib.h>
- #include <string.h>
- //#include "f1.h"
- #include <stdio.h>
- int n=0;
- struct spisoc
- {
- struct spisoc *next=NULL;
- int el=0;
- struct stek *stc;
- };
- struct stek
- {
- struct stek *nex=NULL;
- struct stek *back=NULL;
- int el=0;
- };
- struct spisoc *firt=NULL;// (struct spisoc*)malloc(sizeof( struct spisoc)); óêàçàòåëü íà íà÷àëî
- struct spisoc *rab=NULL;
- struct spisoc *pos=NULL;// óêàçàòåëü íà ïîñëåäíèé
- struct spisoc *tn=firt;
- struct spisoc *tr=firt;
- struct stek *fin=NULL;
- struct stek *se=NULL;
- struct stek *fr= NULL;//(struct stek*)malloc(sizeof( struct stek));
- struct stek *rb= NULL;
- int flag_s=0;
- int flag_d=0;
- using namespace std;
- int dostup()
- {
- int a=0,b=0,c;
- char c1[]="1234";
- char c11[]="max";
- char c2[4],c3[3];
- printf("vvedire loginl: ");
- scanf("%3c3",&c3);
- b=strcmp(c11,c3);
- if(b!=0)
- {
- printf("nepravelni login !%s!%s!\n",c2,c3);
- }
- printf("vvedire porol: ");
- scanf("%s",&c2);
- printf("\n");
- system("cls");
- a=strcmp(c1,c2);
- if(a!=0)
- {
- printf("nepravelni porol\n");
- }
- getch();
- system("cls");
- while((a!=0)||(b!=0))
- {
- printf("vvedire ecpe raz\n");
- printf("vvedire loginl: ");
- scanf("%s",&c3);
- b=strcmp(c11,c3);
- if(b!=0)
- {
- printf("nepravelni login\n");
- }
- printf("vvedire porol: ");
- scanf("%s",&c2);
- printf("\n");
- system("cls");
- a=strcmp(c1,c2);
- if(a!=0)
- {
- printf("nepravelni porol\n");
- }
- }
- return a;
- }
- void stekvnul (void);
- void proverkanul (void);
- void pokazvershni (void);
- void deletveshin (void);
- void vzitel (void);
- void izmenvwrshin (void);
- void dobavit (void);
- void raspechat (void);
- void spisvnul (void);
- void provenanul (void);
- void printstart (void);
- void printfinish (void);
- void deletstart (void);
- void deletefinesh (void);
- void vzytstart (void);
- void vzytfin (void);
- int izmenstart (void);
- int izmenfin (void);
- void givenstart (void);
- void givenfin (void);
- void printst (void);
- int main(int argc, char** argv) {
- int flag=0,a=0,b, fff = 0, fff2 = 0;
- // flag = dostup();
- while(flag==0)
- {
- /*
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printf("%c1 nachat rabotu co ctekom %c\n",178,178);
- printf("%c2 nachat raboru co srocami %c\n",178,178);
- printf("%c0 zaconcht rabotu %c\n",178,178);
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printf("vvedite ¹ comandi:");
- scanf("%d",&a);
- system("cls");*/
- a=2;
- if(a==1){
- while(flag==0)
- {
- z:
- system("cls");
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printf("%c1 nachat rabotu co stekom %c\n",178,178);
- printf("%c2 sdelat stek pustim %c\n",178,178);
- printf("%c3 proverka stek pust/ ne pust %c\n",178,178);
- printf("%c4 pokazat vershini stek %c\n",178,178);
- printf("%c5 ydalit vershini stek %c\n",178,178);
- printf("%c6 vzit element vershini steka %c\n",178,178);
- printf("%c7 izminit znacheniy vershini steka %c\n",178,178);
- printf("%c8 dobavit element v stek %c\n",178,178);
- printf("%c9 raspechatat stuct danih %c\n",178,178);
- printf("%c10 zaconcht rabotu %c\n",178,178);
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printf("vvedite comandi:");
- scanf("%d",&a);
- system("cls");
- switch ( a) {
- case 1:
- printf ("Vi nachali rabotu\n");
- getch();
- fff = 1;
- break;
- case 2:
- if (fff==1)
- stekvnul();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 3:
- if (fff==1)
- proverkanul();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 4:
- if (fff==1)
- {pokazvershni();
- goto a;}
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 5:
- if (fff==1)
- {
- deletveshin();
- goto a;}
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 6:
- if (fff==1)
- {
- vzitel();
- goto a;
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 7:
- if (fff==1)
- {
- izmenvwrshin();
- goto a;
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 8:
- if (fff==1)
- {
- if (flag_s>4)
- printf("Slishkom mnogo elementov\n");
- else
- {
- dobavit();
- goto a;
- }
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 9:
- if (fff==1)
- {
- a:
- raspechat();
- getch();
- system("cls");
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 10:
- flag=1;
- break;
- default:
- break;
- }
- }
- }
- if(a==2){
- while(flag==0)
- {
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printf("%c1 nachat rabotu s decom %c\n",178,178);
- printf("%c2 sdelat dec pustim %c\n",178,178);
- printf("%c3 proverka stek pust/ ne pust %c\n",178,178);
- printf("%c4 pokazat znachenie eleenta vnachelt %c\n",178,178);
- printf("%c5 pokazat znachenie eleenta v konce %c\n",178,178);
- printf("%c6 ydalit eleent v nachale %c\n",178,178);
- printf("%c7 ydalit eleent v konce %c\n",178,178);
- printf("%c8 vzitie eleenta 1 %c\n",178,178);
- printf("%c9 vzitie eleenta n-go %c\n",178,178);
- printf("%c10 izminit eleenta 1 %c\n",178,178);
- printf("%c11 izminit eleenta n-go %c\n",178,178);
- printf("%c12 dobavit eleenta v start %c\n",178,178);
- printf("%c13 dobavit eleenta v finishe %c\n",178,178);
- printf("%c14 raspechatat stuct danih %c\n",178,178);
- printf("%c15 zaconcht rabotu %c\n",178,178);
- printf("%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n",178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178);
- printst ();
- printf("vvedite comandi:");
- scanf("%d",&a);
- system("cls");
- int fg;
- switch ( a) {
- case 1:
- fff2 = 1;
- printf ("Vi nachali rabotu\n");
- case 2:
- if (fff2 == 1)
- spisvnul ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 3:
- if (fff2 == 1)
- provenanul ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 4:
- if (fff2 == 1)
- printstart ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 5:
- if (fff2 == 1)
- printfinish ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 6:
- if (fff2 == 1)
- deletstart ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 7:
- if (fff2 == 1)
- deletefinesh ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 8:
- if (fff2 == 1)
- vzytstart ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 9:
- if (fff2 == 1)
- vzytfin ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 10:
- if (fff2 == 1)
- //{
- {//deletstart ();
- //givenstart ();
- fg=izmenstart ();
- if(fg==1){
- goto z;}
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 11:
- if (fff2 == 1)
- //{
- {
- fg=izmenfin ();
- if(fg==1){
- // deletefinesh();
- //givenfin();
- goto z;}
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 12:
- if (fff2 == 1)
- {
- if(flag_d>4)
- printf ("Slishkom mnogo elementov\n");
- else{
- givenstart ();
- goto z;
- }
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 13:
- if (fff2 == 1)
- {
- if (flag_d>4)
- printf ("Slishkom mnogo elementov\n");
- else
- {givenfin ();goto z;}
- }
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 14:
- if (fff2 == 1)
- printst ();
- else
- printf ("Vi ne nachali rabotu\n");
- getch();
- break;
- case 15:
- {flag=1;
- system("cls");
- exit(0);
- }
- break;
- default:
- break;
- }
- }}
- if(a!=0)
- {
- flag=0;
- }
- else
- {
- flag=1;
- }
- }
- return 0;
- }
- // stek/////////////////////////////////////////////////////////////////////
- void stekvnul(void)
- {
- rb=NULL;
- printf("SRABOTALO\nstrukt delete\n");
- flag_s = 0;
- getch();
- system("cls");
- }
- void proverkanul (void)
- {
- if(rb==NULL)
- {
- printf("stek PUST");
- }
- else
- {
- printf("stek NE PUST");
- }
- getch();
- system("cls");
- }
- void pokazvershni (void)
- {
- if (rb!=NULL)
- {
- printf("vershina steca: >%d< = %d %d %d\n",rb->el,rb->back,rb,rb->nex);
- }
- else
- printf ("stek pust\n");
- getch();
- system("cls");
- }
- void deletveshin (void)
- {
- if (rb!=NULL)
- {
- fin=rb->back;
- rb=rb->back;
- rb->nex=NULL;
- printf("delete OK");
- }
- else
- printf ("stek pust\n");
- if (flag_s>=0)
- flag_s--;
- getch();
- system("cls");
- }
- void vzitel (void)
- {
- if (rb!=NULL)
- {
- printf("bil vzyt eement: >%d< = %d %d %d\n",rb->el,rb->back,rb,rb->nex);
- fin=rb->back;
- rb=rb->back;
- rb->nex=NULL;
- printf("delete OK");
- }
- else
- printf ("stek pust\n");
- if (flag_s>=0)
- flag_s--;
- getch();
- system("cls");
- }
- void izmenvwrshin (void)
- {
- int b;
- if (rb!=NULL)
- {
- printf("vvedite chislo: ");
- scanf("%d",&b);
- rb->el=b;
- }
- else
- printf ("stek pust\n");
- getch();
- system("cls");
- }
- void dobavit (void)
- {
- int b,t=0;
- printf("vvedite chislo: ");
- scanf("%d",&b);
- if(rb==NULL)
- {
- printf("SRABOTALO\n");
- rb=( stek*)malloc(sizeof( struct stek));
- rb->back=NULL;
- rb->el=b;
- rb->nex=NULL;
- fin=rb;
- printf("%d = %d %d %d\n",rb->el,rb->back,rb,rb->nex);
- t=1;
- }
- if((rb!=NULL)&&(t==0))
- {
- rb->nex = ( stek*)malloc(sizeof( struct stek));
- se=rb;
- rb=rb->nex;
- rb->back=se;
- rb->el=b;
- rb->nex=NULL;
- fin=rb;
- printf("%d = %d %d %d\n",rb->el,rb->back,rb,rb->nex);
- }
- // fin=rb;
- tn->stc=rb;
- flag_s++;
- getch();
- system("cls");
- }
- void raspechat (void)
- { int flag=0;;
- //fin=rb;
- tn->stc=rb;
- printf("znachenie steca: ");
- while (rb!=NULL)
- {
- if(flag==0){
- printf(">");
- }
- printf("%d ",rb->el);
- if(flag==0){
- printf("<");
- flag=1;
- }
- // printf("= %d %d %d\n",rb->back,rb,rb->nex);
- rb=rb->back;
- }
- rb=tn->stc;
- printf ("bolshe nechego pechatat");
- }
- // dec///////////////////////////////////////////////////////////////////////////
- void spisvnul (void) //2
- {
- printf("structura dec delete\n");
- tn=NULL;
- rab=NULL;
- firt=NULL;
- printf("structura dec delete\n");
- getch();
- flag_d = 0;
- flag_s = 0;
- system("cls");
- n=0;
- }
- void provenanul (void) //3
- {
- rab=firt;
- if(rab==NULL)
- {
- printf("dec PUST");
- }
- else
- {
- printf("dec NE PUST");
- }
- getch();
- system("cls");
- }
- void printstart (void) //4
- {
- if(firt!=NULL)
- {
- printf("element v nachale deca: %d\n",firt);
- rb=firt->stc;
- while(rb!=NULL)
- {
- printf ("stek: %d\n",rb->el);
- rb=rb->back;
- }
- printst();
- }
- else
- {
- printf ("y nas net elementov");
- }
- // printst();
- getch();
- system("cls");
- }
- void printfinish (void) //5
- {
- if(pos!=NULL)
- {
- printf("element v konce deca: %d\n",pos);
- rb=pos->stc;
- while(rb!=NULL)
- {
- printf ("stek: %d\n",rb->el);
- rb=rb->back;
- }
- printst();
- }
- else
- {
- printf ("y nas net elementov");
- }
- getch();
- system("cls");
- }
- void deletstart (void) //6
- {
- if(firt!=NULL)
- {
- firt=firt->next;
- printf("delete OK");
- //raspechat();
- printst();
- }
- else
- { printf("struct ne suchestvuet \n");
- printf("delete ne OK\n");
- }
- if (flag_d>=0)
- flag_d--;
- flag_s = 0;
- getch();
- system("cls");
- }
- void deletefinesh (void) //7
- {
- if(firt!=NULL)
- {
- rab=firt;
- while(rab!=NULL)
- {
- if(rab->next==pos)
- {
- pos=rab;
- pos->next=NULL;
- }
- rab=rab->next;
- }
- printf("delete OK");
- //raspechat();
- printst();
- }
- else
- { printf("struct ne suchestvuet\n");
- printf("delete ne OK\n");
- }
- if (flag_d>=0)
- flag_d--;
- flag_s = 0;
- getch();
- system("cls");
- }
- void vzytstart (void) //8
- {
- printstart();
- deletstart();
- }
- void vzytfin (void) //9
- {
- printfinish();
- deletefinesh();
- }
- int izmenstart () //10
- {
- flag_s = 0;
- if(firt!=NULL){
- rb=firt->stc;
- //deletstart();
- //givenstart();
- getch();
- system("cls");
- return 1;
- }
- else
- {printf(" y nac net strectur nam ne c chem rabotat");
- getch();
- system("cls");
- return 0;
- }
- }
- int izmenfin () //11
- {
- flag_s = 0;
- if(firt!=NULL){
- rb=pos->stc;
- //deletefinesh();
- //givenfin();
- getch();
- system("cls");
- return 1;
- }
- else
- {printf(" y nac net strectur nam ne c chem rabotat");
- getch();
- system("cls");
- return 0;
- }
- }
- void givenstart (void) //12
- {
- if(firt==NULL)
- {
- printf("1 zashlo\n");
- firt=(struct spisoc*)malloc(sizeof( struct spisoc));
- printf("1 zashlo\n");
- pos=firt;
- printf("1 zashlo\n");
- firt->next=NULL;
- printf("1 zashlo\n");
- pos->next=NULL;
- printf("1 zashlo\n");
- rab=firt;
- printf("rab =%d %d %d\n",rab,rab->next,rab->stc);
- printf("pos =%d %d %d\n",pos,pos->next,pos->stc);
- printf("firt =%d %d %d\n",firt,firt->next,firt->stc);
- tn=firt;
- }
- else
- {
- rab=firt;
- printf("2 zashlo\n");
- firt=(struct spisoc*)malloc(sizeof( struct spisoc));
- firt->next=rab;
- printf("rab =%d %d %d\n",rab,rab->next,rab->stc);
- printf("pos =%d %d %d\n",pos,pos->next,pos->stc);
- printf("firt =%d %d %d\n",firt,firt->next,firt->stc);
- tn=firt;
- }
- printf("tn =%d %d %d\n",tn,tn->next,tn->stc);
- tn->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- /*
- if(firt->next==NULL)
- {
- firt->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- }
- if(firt->next!=NULL)
- {
- rab=firt->next;
- rab->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- }*/
- flag_d++;
- flag_s = 0;
- printf("NOW sozdan\n");
- getch();
- system("cls");
- }
- void givenfin (void) //13
- {
- if(firt==NULL)
- {
- printf("1 zashlo\n");
- firt=(struct spisoc*)malloc(sizeof( struct spisoc));
- pos=firt;
- firt->next=NULL;
- pos->next=NULL;
- rab=firt;
- printf("rab =%d %d %d\n",rab,rab->next,rab->stc);
- printf("pos =%d %d %d\n",pos,pos->next,pos->stc);
- printf("firt =%d %d %d\n",firt,firt->next,firt->stc);
- tn=pos;
- }
- else
- {
- if(firt->next==NULL)
- {
- rab=firt;
- printf("2 zashlo\n");
- pos->next=(struct spisoc*)malloc(sizeof( struct spisoc));
- firt->next=pos->next;
- rab=pos;
- pos=pos->next;
- pos->next=NULL;
- printf("rab = %d %d %d\n",rab,rab->next,rab->stc);
- printf("pos =%d %d %d\n",pos,pos->next,pos->stc);
- printf("firt =%d %d %d\n",firt,firt->next,firt->stc);
- tn=pos;
- }
- else
- {
- printf("3 zashlo\n");
- pos->next=(struct spisoc*)malloc(sizeof( struct spisoc));
- rab=pos;
- pos=pos->next;
- pos->next=NULL;
- printf("rab =%d %d %d\n",rab,rab->next,rab->stc);
- printf("pos =%d %d %d\n",pos,pos->next,pos->stc);
- printf("firt =%d %d %d\n",firt,firt->next,firt->stc);
- tn=pos;
- }
- }
- printf("tn =%d %d %d\n",tn,tn->next,tn->stc);
- tn->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- flag_d++;
- flag_s = 0;
- printf("NOW sozdan\n");
- getch();
- system("cls");
- }
- void printst (void) //14
- {
- tn=firt;
- if(tn==NULL)
- printf("PUSTO\n");
- else
- printf("OK\n");
- while(tn!=NULL)
- {
- printf("DEC:\n");
- printf ("----------------\n");
- rb=tn->stc;
- while(rb!=NULL)
- {
- printf ("stek: %d\n",rb->el);
- rb=rb->back;
- }
- tn=tn->next;
- }
- //getch();
- // system("cls");
- }
- /*void printzaukaz (void) //7
- {
- if(tn->next!=NULL)
- {
- rab=tn->next;
- rb=rab->stc;
- printf("element za rabochim ucazatelem: %d %d %d\n",rab,rab->stc,rab->next);
- raspechat();
- }
- else
- {
- printf ("ucazatel v konce spica");
- }
- getch();
- system("cls");
- }
- void deletezaukaz (void) //8
- {
- if(tn->next!=NULL)
- {
- rab=tn;
- rab=rab->next;
- tn->next=rab->next;
- rb=rab->stc;
- //printf("tn =%d %d %d\n",tn,tn->next,tn->stc);
- printf("delete OK");
- //raspechat();
- }
- else
- { printf("nash ukazatel naxoditsa v konse(rekomenduetsa ego peredvinut)\n");
- printf("delete ne OK\n");
- }
- getch();
- system("cls");
- }
- void vzytzaukaz (void) //9
- {
- if(tn->next!=NULL)
- {
- rab=tn;
- rab=rab->next;
- rb=rab->stc;
- printf("vzytiy element za rabochim ucazatelem: >%d< %d %d",rab,rab->stc,rab->next);
- raspechat();
- tn->next=rab->next;
- printf("tn =%d %d %d\n",tn,tn->next,tn->stc);
- }
- else
- { printf("nash ukazatel naxoditsa v konse(rekomenduetsa ego peredvinut)");
- }
- getch();
- system("cls");
- }
- void izmenzaukaz (void) //10
- {
- if(tn->next!=NULL)
- {
- rab=tn->next;
- rab->stc=( stek*)malloc(sizeof( struct stek));
- //stekvnul();
- }
- else
- {printf("nash ukazatel naxoditsa v konse(rekomenduetsa ego peredvinut)\n");
- }
- }
- void givenzaukaz (void) //11
- {
- int o=1;
- if(n==0&&rab==NULL)
- {
- n++;o=0;
- printf("1 zashlo\n");
- firt=(struct spisoc*)malloc(sizeof( struct spisoc));
- rab=firt;
- firt->next=rab;
- rab->next=NULL;
- tn=rab;
- rab->el=n;
- printf("rab =%d %d %d\n",rab,rab->next,rab->stc);
- printf("tn =%d %d %d\n",tn,tn->next,tn->stc);
- printf("firt=%d %d %d\n",firt,firt->next,firt->stc);
- }
- if((tn!=NULL)&&(tn->next==NULL)&&(o==1))
- {
- printf("2 zashlo\n");
- rab=tn;
- rab->next=(struct spisoc*)malloc(sizeof( struct spisoc));
- rab=rab->next;
- rab->next=NULL;
- tn->next=rab;
- printf("firt=%d %d %d\n",firt,firt->next,firt->stc);
- printf("rab=%d %d %d\n",rab,rab->next,rab->stc);
- printf("tn=%d %d %d\n",tn,tn->next,tn->stc);
- n++;
- rab->el=n;
- o=0;
- }
- if((tn!=NULL)&&(tn->next!=NULL)&&(o==1))
- {
- printf("3 zashlo\n");
- printf("tn=%d %d %d\n",tn,tn->next,tn->stc);
- tr=(struct spisoc*)malloc(sizeof( struct spisoc));
- printf("tr=%d %d %d\n",tr,tr->next,tr->stc);
- rab=tn;
- rab=rab->next;
- printf("rab=%d %d %d\n",rab,rab->next,rab->stc);
- tr->next=rab;
- printf("tr=%d %d %d\n",tr,tr->next,tr->stc);
- tn->next=tr;
- printf("tn=%d %d %d\n",tn,tn->next,tn->stc);
- //tr->stc=NULL;
- rab=tr;
- }
- //tn->stc=NULL;
- //rab->stc=NULL;
- if(tn->next==NULL)
- {
- rab->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- }
- if(tn->next!=NULL)
- {
- tn=tn->next;
- rab->stc=( stek*)malloc(sizeof( struct stek));
- stekvnul();
- }
- printf("NOW sozdan\n");
- getch();
- system("cls");
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement