#include
#include<stdlib.h>
using namespace std;
typedef struct node{
char data;
struct node *l,*r;
}Tree;
int obj=0;
void init(Tree *&l)
{
char ch;
cin>>ch;
if(ch==’#’) l=NULL;
else
{
l=(Tree *)malloc(sizeof(Tree));
l->data=ch;
init(l->l);
init(l->r);
}
}
void getnode(Tree *&l)
{
if(l)
{ if(l->lNULL) obj++;
if(l->rNULL) obj++;
if(l->l!=NULL) getnode(l->l);
if(l->r!=NULL) getnode(l->r);
}
}
int main()
{
Tree *l;
init(l);
getnode(l);
cout<<obj;
return 0;
}
医学影像技术1802 戴明镜