Orar semigroup #2

Orar semigroup #2

6/8

#include<iostream>
using namespace std;

struct nod{int info;
nod* st,*dr;};

nod* creare()
{int x;
cin>>x;
if(x)
{nod*p=new nod;
p->info=x;
p->st=creare();
p->dr=creare();
return p;}
else return NULL;}

void RSD(nod* R)
{if(R)
{cout<<R->info;
RSD(R->st);
RSD(R->dr);}
}

int main()
{nod* R;
R=creare();
RSD(R);
}

joi, 7 iunie 2012 by DlMuresan
Categories: , , | Leave a comment

Leave a Reply