Erica Posted May 31, 2018 at 01:04 PM Report #610797 Posted May 31, 2018 at 01:04 PM Ola!! Bom dia!! Gostaria de sua nesse trabalho que estou fazendo estou como muita dificuldade pra fazer. Você pode me ajudar?? #include <stdio.h> #include <stdlib.h> #include <locale.h> #include <string.h> int menu(void){ int opt; printf("Escolha a Opcao \n"); printf("1. Criar Lista \n"); printf("2.Inserir na Lista \n"); printf("3. Imprimir Lista \n"); printf("4. Separar Lista \n"); printf("5. Deletar \n"); printf("6. Sair \n"); printf("Opcao:"); scanf("%d", &opt); return opt; } struct NO{ int elemento; struct NO *prox; }; typedef struct{ struct NO *inicio; }lista; int tam; void init(lista *lista) { lista->inicio = NULL; tam=0; } void insere(lista **topo, int ls){ lista *novo; struct NO **novo = (struct NO*) malloc(sizeof(struct NO)); novo->elemento = ls; if(*topo==NULL){ novo->prox = NULL; *topo = novo; }else{ novo->prox = *topo; *topo = novo; } } void imprime(lista **topo){ lista *aux; aux = topo; if(aux = NULL){ }else{ do{ printf("%d", aux->elemento); aux = aux->prox; }while(aux!=NULL); } } void separar(){ } main(){ init(&ls); lista *topo = NULL; insere(&topo); imprime(topo); }
HappyHippyHippo Posted May 31, 2018 at 01:11 PM Report #610798 Posted May 31, 2018 at 01:11 PM e qual é mesmo a dificuldade ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now