⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sub9.cpp

📁 STRUCTURI DE DATE SI ALGORITMI
💻 CPP
字号:
#include"glista.cpp"

void afisL(GLista L);
void afisAt(GLista L);
void afisprel(GLista L);

void main()
{
GLista L;
clrscr();
printf("\nIntroduceti elementele listei :\n");
L=creareGLista();
printf("\nAtomii :");
afisAt(L);
printf("\nLista citita :");
afisL(L);
printf("\nLista prelucrata :");
afisprel(L);
getch();
}

void afisAt(GLista L)
{
GElement *p;
p=L;
while(p!=0)
	{
	if(p->tag==ATOM)
		printf(" %c",p->data.A);
	else
		afisAt(p->data.L);
	p=p->link;
	}
}



void afisL(GLista L)
{
GElement *p;
p=L;
printf("(");
while(p!=0)
	{
	if(p->tag==ATOM)
		{
		printf("%c",p->data.A);
		if(p->link!=NULL)
			printf(",");
		}
	else
		{
		afisL(p->data.L);
		if(p->link!=NULL)
			printf(",");
		}
	p=p->link;
	}
printf(")");
}


void afisprel(GLista L)
{
GElement *p;
p=L;
printf("(");
while(p!=0)
	{
	if(p->tag==ATOM)
		{
		printf("%c",p->data.A);
		if(p->link!=NULL)
			printf(",");
		}
	else
		{
		if(p->data.A!='')
			{
			afisprel(p->data.L);
			if(p->link!=NULL)
				printf(",");
			}
		}
	p=p->link;
	}
printf(")");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -