Hello,

Para realizar o cadastro, você pode preencher o formulário ou optar por uma das opções de acesso rápido disponíveis.

Welcome Back,

Por favor, insira suas informações de acesso para entrar ou escolha uma das opções de acesso rápido disponíveis.

Forgot Password,

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Captcha Click on image to update the captcha.

You must login to ask a question.

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

PergunteAqui Latest Questions

  • 0
Anônimo(a)

Ajuda em Linguagem “C”?

Alguem podertia me ajudar no exercicio abaixo:

Implementar em linguagem C uma “pilha” e programar as seguintes funções:

push()
pop()
top()
empty()

You must login to add an answer.

1 Answer

  1. typedef struct lstack *stack;
    typedef struct lstack{
    double value;
    stack next;
    }dl_stack;

    stack init (void){
    return NULL;
    }
    double stack_top(stack s){
    return s->value;
    }
    void stack_topln (stack s){
    if (s)
    printf(“%.4f\n”,stack_top(s));
    }
    void stack_push (stack *s,double x){
    stack r = (stack) malloc (sizeof(dl_stack));
    r->value=x;
    r->next=*s;
    *s=r;
    }
    void stack_pop (stack *s){
    if (*s){
    stack r=*s;
    *s = (*s)->next;
    free(r);
    }
    }

    acho que ta ai tudo
    espero ter ajudado.

Related Questions