#include<stdio.h>
#include<stdlib.h>
typedef struct treeNode *ptr;
struct treeNode
{
char element[225];
int size;
ptr child;
ptr brother;
};
int comput(treeNode file,int deep)
{
int total=0;
if(file!=NULL)
{
total+=file->size;
total+=comput(file->child,deep+1)+comput(file->brother,deep);
putout(file,deep);
}
return total;
}
void putout(treeNode name,int deep)
{
for(int step=0;step<deep;step++)
printf(" ");
printf("%s %d\n",name->element,size);
}