Cod sursa(job #1191421)

Utilizator lucian.okapiNestian Lucian-Dan lucian.okapi Data 27 mai 2014 16:11:10
Problema Jocul Flip Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.71 kb
#include <iostream>

using namespace std;

struct Nod
{
    int info;
    Nod *leg;
};
Nod *L;

void Creare(int x)
{
    L=new Nod;
    L->info=x;
    L->leg=NULL;
}
void InserareInceput(int x)
{
    Nod *p;
    p=new Nod;
    p->info=x;
    p->leg=L;
    L=p;
}

void InserareInterior(Nod *p,int x)
{
    Nod *q;
    q=new Nod;
    q->leg=p->leg;
    q->info=x;
    p=q;
}
void DeleteInceput()
{
    Nod *p;
    p=L->leg;
    delete L;
    L=p;
}
void DeleteInterior(Nod *p)
{
    Nod *q;
    q=new Nod;
    q=p->leg->leg;
    delete p->leg;
    p->leg=q;
}
void Parcurgere()
{
    Nod *p;
    for(p=L;p!=NULL;p=p->leg)
        cout<<p->info<<" ";
}


int main()
{
    Creare(10);
    InserareInceput(9);


    return 0;
}